59 #ifndef ACG_STOPWATCH_HH 60 #define ACG_STOPWATCH_HH 76 #include "../Config/ACGDefines.hh" 103 QueryPerformanceFrequency(&freq_);
105 starttime_.tv_sec = 0;
106 starttime_.tv_usec = 0;
108 endtime_.tv_usec = 0;
118 QueryPerformanceCounter(&starttime_);
120 starttime_ = current_time();
127 QueryPerformanceCounter(&endtime_);
129 endtime_ = current_time();
140 QueryPerformanceCounter(&endtime_);
142 endtime_ = current_time();
151 return (
double)(endtime_.QuadPart - starttime_.QuadPart)
152 / (
double)freq_.QuadPart * 1000.0f;
154 return ((endtime_.tv_sec - starttime_.tv_sec )*1000.0 +
155 (endtime_.tv_usec - starttime_.tv_usec)*0.001);
163 LARGE_INTEGER starttime_, endtime_;
166 timeval current_time()
const {
168 gettimeofday(&tv, 0);
172 timeval starttime_, endtime_;
181 #endif // ACG_STOPWATCH_HH defined
double restart()
Restart, return time elapsed until now.
double elapsed() const
Get the total time in milli-seconds (watch has to be stopped).
void start()
Start time measurement.
double stop()
Stop time measurement, return time.
Namespace providing different geometric functions concerning angles.