Stopwatch.h
Go to the documentation of this file.
1 #ifndef _utl_Stopwatch_h_
2 #define _utl_Stopwatch_h_
3 
4 #include <sys/times.h>
5 #include <utl/AugerUnits.h>
6 
7 namespace utl {
8 
16  class Stopwatch {
17 
18  public:
19  enum CPUTime {
23  };
24 
25  Stopwatch();
26 
27  void Reset();
28  void Start();
29  void Stop();
30  double GetCPUTime(const CPUTime kind = eTotal);
31 
32  private:
33  static const long fgClockTicks;
34  bool fIsStopped;
35  struct tms fStart;
36  clock_t fUserTimeSum;
37  clock_t fSystemTimeSum;
38 
39  };
40 
41 } // namespace utl
42 
43 #endif
44 
45 // Configure (x)emacs for this file ...
46 // Local Variables:
47 // mode: c++
48 // End:
struct tms fStart
Definition: Stopwatch.h:35
clock_t fUserTimeSum
Definition: Stopwatch.h:36
void Reset()
Definition: Stopwatch.cc:21
void Start()
Definition: Stopwatch.cc:29
clock_t fSystemTimeSum
Definition: Stopwatch.h:37
bool fIsStopped
Definition: Stopwatch.h:34
static const long fgClockTicks
Definition: Stopwatch.h:33
double GetCPUTime(const CPUTime kind=eTotal)
Definition: Stopwatch.cc:52

, generated on Tue Sep 26 2023.