33 QueryPerformanceFrequency(&l);
34 invFreq = 1.0f / l.QuadPart;
46 QueryPerformanceCounter(&l);
47 resetStamp = (((double)l.QuadPart) * invFreq);
53 QueryPerformanceCounter(&l);
54 return (
float)(((double)l.QuadPart) * invFreq - resetStamp);
60 float interval = time - lastInterval;
69 if (time-lastFpsUpdate > 1.0
f)
87 , lastIntervalTime(0.0
f)
114 return seconds + milliseconds;
121 lastIntervalTime =
time;
Timer()
Default Constructor.
float getTime()
Returns the time passed since object creation or since reset() was last called.
float getFPS()
Returns the FPS (Frames Per Second).
void reset()
Resets the timer to 0.0f.
float getInterval()
Returns the time passed since getInterval() was last called.
bool isTimePassed(float seconds=1.0f)
Tests if 'seconds' seconds have passed since reset() or this method was called.