28 ClassImp(TGLStopwatch);
33 TGLStopwatch::TGLStopwatch() : fStart(0), fEnd(0), fLastRun(0)
40 TGLStopwatch::~TGLStopwatch()
47 void TGLStopwatch::Start()
57 Double_t TGLStopwatch::Lap()
const
62 return GetClock() - fStart;
69 Double_t TGLStopwatch::End()
75 fLastRun = fEnd - fStart;
83 Double_t TGLStopwatch::GetClock(
void)
const
87 static LARGE_INTEGER perfFreq;
88 static Bool_t usePerformanceCounter = QueryPerformanceFrequency(&perfFreq);
90 if (usePerformanceCounter) {
91 LARGE_INTEGER counter;
92 QueryPerformanceCounter(&counter);
93 Double_t time =
static_cast<Double_t
>(counter.QuadPart)*1000.0 /
94 static_cast<Double_t>(perfFreq.QuadPart);
103 GetSystemTimeAsFileTime(&ft);
104 uli.LowPart = ft.dwLowDateTime;
105 uli.HighPart = ft.dwHighDateTime;
107 return static_cast<Double_t
>(t /= 1E4);
110 gettimeofday(&tv, 0);
111 return static_cast<Double_t
>(tv.tv_sec*1E3) + static_cast<Double_t>(tv.tv_usec) / 1E3;