Panda3D
pStatTimer.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file pStatTimer.I
10  * @author drose
11  * @date 2000-07-11
12  */
13 
14 #ifdef DO_PSTATS
15 
16 /**
17  *
18  */
19 INLINE PStatTimer::
20 PStatTimer(PStatCollector &collector) :
21  _collector(collector),
22  _thread(PStatClient::get_global_pstats()->get_current_thread())
23 {
24  _collector.start(_thread);
25 }
26 
27 /**
28  *
29  */
30 INLINE PStatTimer::
31 PStatTimer(PStatCollector &collector, Thread *current_thread) :
32  _collector(collector),
33  _thread(current_thread)
34 {
35  _collector.start(_thread);
36 }
37 
38 /**
39  *
40  */
41 INLINE PStatTimer::
42 ~PStatTimer() {
43  _collector.stop(_thread);
44 }
45 
46 #endif
A lightweight class that represents a single element that may be timed and/or counted via stats.
A thread; that is, a lightweight process.
Definition: thread.h:46
Manages the communications to report statistics via a network connection to a remote PStatServer.
Definition: pStatClient.h:263