53 #ifndef ACG_STOPWATCH_HH 54 #define ACG_STOPWATCH_HH 70 #include "../Config/ACGDefines.hh" 97 QueryPerformanceFrequency(&freq_);
99 starttime_.tv_sec = 0;
100 starttime_.tv_usec = 0;
102 endtime_.tv_usec = 0;
112 QueryPerformanceCounter(&starttime_);
114 starttime_ = current_time();
121 QueryPerformanceCounter(&endtime_);
123 endtime_ = current_time();
134 QueryPerformanceCounter(&endtime_);
136 endtime_ = current_time();
145 return (
double)(endtime_.QuadPart - starttime_.QuadPart)
146 / (
double)freq_.QuadPart * 1000.0f;
148 return ((endtime_.tv_sec - starttime_.tv_sec )*1000.0 +
149 (endtime_.tv_usec - starttime_.tv_usec)*0.001);
157 LARGE_INTEGER starttime_, endtime_;
160 timeval current_time()
const {
162 gettimeofday(&tv, 0);
166 timeval starttime_, endtime_;
175 #endif // ACG_STOPWATCH_HH defined Namespace providing different geometric functions concerning angles.
double stop()
Stop time measurement, return time.
void start()
Start time measurement.
double elapsed() const
Get the total time in milli-seconds (watch has to be stopped).
double restart()
Restart, return time elapsed until now.