00001
00003 #ifndef _STOPWATCH_H
00004 #define _STOPWATCH_H
00005
00006
00007
00036 typedef enum {
00037 USER_TIME,
00038 SYSTEM_TIME,
00039 ABSOLUTE_TIME
00040 } time_type;
00041
00042
00043
00044 class stopwatch {
00045
00046 private:
00047
00048
00049
00050
00051
00052 time_type _type;
00053
00054
00055 long long int _previous_clock_value;
00056 long long int _total_time_value;
00057 bool _time_pause;
00058
00059
00060
00061
00062
00067 long long int _take_the_clock();
00068
00069
00070
00071
00072
00073 public:
00074
00080 stopwatch(time_type = USER_TIME);
00081
00086 void start();
00087
00091 void reset();
00092
00096 double get();
00097
00103 double pause();
00104
00105 };
00106
00107 #endif // _STOPWATCH_H
00108