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 #include "Definitions.h"
00022
00023 #ifdef SYSTEM_TIME
00024
00025 #include <sys/times.h>
00026
00027 #ifndef CLK_TCK
00028 #define CLK_TCK 100
00029 #endif
00030
00031 #else
00032
00033 #include <ctime>
00034
00035 #endif
00036
00037 using namespace std;
00038
00039 #ifndef TIMER_H
00040 #define TIMER_H
00041
00042 namespace ColPack
00043 {
00052 class Timer
00053 {
00054 private:
00055
00057
00063 #ifdef SYSTEM_TIME
00064
00065 struct tms tms_BeginTimer;
00066 struct tms tms_EndTimer;
00067 #endif
00068
00069 clock_t ct_BeginTimer;
00070 clock_t ct_EndTimer;
00071
00072
00073 public:
00074
00075
00076 Timer();
00077
00078
00079 ~Timer();
00080
00081
00082 void Start();
00083
00084
00085 void Stop();
00086
00087
00088 double GetWallTime();
00089
00090
00091 double GetProcessorTime();
00092
00093
00094 double GetUserProcessorTime();
00095
00096
00097 double GetSystemProcessorTime();
00098 };
00099 }
00100 #endif