Teamcenter C++ API Reference  2312
Timer.hxx
Go to the documentation of this file.
1 // ==================================================
2 // Copyright 2013.
3 // Siemens Product Lifecycle Management Software Inc.
4 // All Rights Reserved.
5 // ==================================================
6 
13 #ifndef BASE_UTILS_TIMER_HXX
14 #define BASE_UTILS_TIMER_HXX
15 
16 #include <unidefs.h>
18 
19 #include <base_utils/libbase_utils_exports.h>
20 
25 {
26  double cpu_time;
27  double child_cpu_time;
28  double real_time;
30 
40 class BASE_UTILS_API Timer
41 {
42 public:
43 
47  Timer(
48  logical startNow = true
49  );
50 
54  ~Timer();
55 
59  void start();
60 
64  void stop();
65 
71  void reset();
72 
82  const char* elapsedString() const;
83 
87  void readTimer(
89  ) const;
90 
106  char* logElapsedString(
107  const char* text
108  ) const;
109 
113  static bool isLoginTimerEnabled();
114 
115 private:
117  unsigned short m_timer;
118 
122  mutable char m_buffer[128];
123 
127  Timer( const Timer& other );
128 
132  Timer& operator=( const Timer& other );
133 
134  static bool s_logEnabled;
135  static bool s_logEnabledChecked;
136  static double s_incrementalCpu;
137  static double s_incrementalReal;
138 };
139 
140 #include <base_utils/libbase_utils_undef.h>
141 #endif
142