Win32::Win32Timer Class Reference
#include <win32timer.h>
Inheritance diagram for Win32::Win32Timer:
Detailed Description
Win32 implementation of the Time::Timer class. Under Win32, time measurement uses the QueryPerformanceCounter() methods.
- Todo:
- solve multiprocessor issues of QueryPerformanceCounter() (different processors may return different PerformanceFrequency values, thus, threads should be prevented from switching between processors with thread affinities).
Public Member Functions | |
Win32Timer () | |
constructor | |
void | Start () |
start/continue the timer | |
void | Stop () |
stop the timer | |
void | Reset () |
reset the timer | |
bool | Running () const |
return true if currently running | |
Timing::Time | GetTime () const |
get current time in seconds | |
uint | GetTicks () const |
get current time in ticks |
Member Function Documentation
void Win32::Win32Timer::Start | ( | ) |
start/continue the timer
Start the timer. This will update the diffTime member to reflect the accumulated time when the timer was not running (basically the difference between this timer's time and the real system time).
void Win32::Win32Timer::Stop | ( | ) |
void Win32::Win32Timer::Reset | ( | ) |
reset the timer
Reset the timer so that will start counting at zero again.
bool Win32::Win32Timer::Running | ( | ) | const |
return true if currently running
Returns true if the timer is currently running.
Timing::Time Win32::Win32Timer::GetTime | ( | ) | const |
get current time in seconds
This returns the timer's current time in seconds.
uint Win32::Win32Timer::GetTicks | ( | ) | const |
get current time in ticks
This returns the timer's current time in "ticks".