Nebula
|
#include <win32timer.h>
Win32 implementation of the Time::Timer class.
Uses the QueryPerformanceCounter() functions.
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 | |
Timing::Tick | GetTicks () const |
get current time in ticks | |
Private Member Functions | |
__int64 | InternalTime () const |
return internal time as 64 bit integer | |
Private Attributes | |
bool | running |
__int64 | diffTime |
__int64 | stopTime |
Win32::Win32Timer::Win32Timer | ( | ) |
constructor
Timing::Tick Win32::Win32Timer::GetTicks | ( | ) | const |
get current time in ticks
This returns the timer's current time in "ticks".
A tick is defined as one millisecond (1/1000 seconds).
Timing::Time Win32::Win32Timer::GetTime | ( | ) | const |
get current time in seconds
This returns the timer's current time in seconds.
|
private |
return internal time as 64 bit integer
This returns the internal local time as large integer.
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.
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 | ( | ) |
|
private |
|
private |
|
private |