Timer.h++
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __ccxx_Timer_hxx
00024 #define __ccxx_Timer_hxx
00025
00026 #include <commonc++/Common.h++>
00027
00028 namespace ccxx {
00029
00038 class COMMONCPP_API Timer
00039 {
00040 public:
00041
00043 Timer() throw();
00044
00046 virtual ~Timer() throw();
00047
00051 void start() throw();
00052
00056 void stop() throw();
00057
00061 inline void pause() throw()
00062 { stop(); }
00063
00067 inline void resume() throw()
00068 { start(); }
00069
00071 void reset() throw();
00072
00076 inline uint64_t elapsedKernelTime() const throw()
00077 { return(_kernelElapsed); }
00078
00082 inline uint64_t elapsedUserTime() const throw()
00083 { return(_userElapsed); }
00084
00088 inline uint64_t elapsedRealTime() const throw()
00089 { return(_realElapsed); }
00090
00092 inline bool isRunning() const throw()
00093 { return(_running); }
00094
00095 private:
00096
00097 time_ms_t _userTime;
00098 time_ms_t _kernelTime;
00099 time_ms_t _realTime;
00100
00101 uint64_t _userElapsed;
00102 uint64_t _kernelElapsed;
00103 uint64_t _realElapsed;
00104
00105 bool _running;
00106
00107 CCXX_COPY_DECLS(Timer);
00108 };
00109
00110 };
00111
00112 #endif // __ccxx_Timer_hxx
00113
00114