#include <CTimer.h>
Public Member Functions | |
CTimer (void) | |
void | Update () |
void | Pause (void) |
void | Resume (void) |
void | SetSpeed (float Speed) |
float | GetDeltaTime (void) |
double | GetTime (void) |
Private Member Functions | |
double | GetCurrentTime () |
Private Attributes | |
__int64 | m_StartClock |
double | m_InvRate |
double | m_Time |
float | m_DeltaTime |
bool | m_Pause |
float | m_DeltaTimeAtPause |
float | m_Speed |
It can return the current time since the construction of the timer, and the deltatime (time between last call to get deltatime and the next call). It also handles pauses during the execution so that the deltatime when resuming is not huge but normal.
CTimer::CTimer | ( | void | ) | [inline] |
double CTimer::GetCurrentTime | ( | ) | [inline, private] |
void CTimer::Update | ( | void | ) | [inline] |
void CTimer::Pause | ( | void | ) | [inline] |
void CTimer::Resume | ( | void | ) | [inline] |
void CTimer::SetSpeed | ( | float | Speed | ) | [inline] |
float CTimer::GetDeltaTime | ( | void | ) | [inline] |
double CTimer::GetTime | ( | void | ) | [inline] |
__int64 CTimer::m_StartClock [private] |
double CTimer::m_InvRate [private] |
double CTimer::m_Time [private] |
float CTimer::m_DeltaTime [private] |
bool CTimer::m_Pause [private] |
float CTimer::m_DeltaTimeAtPause [private] |
float CTimer::m_Speed [private] |