proper timer class placeholders
This commit is contained in:
parent
1cd0489dfe
commit
30c1062893
|
@ -10,7 +10,7 @@ Lib::Timer::Timer() {
|
||||||
QueryPerformanceFrequency(&f);
|
QueryPerformanceFrequency(&f);
|
||||||
m_Frequency = f.QuadPart;
|
m_Frequency = f.QuadPart;
|
||||||
#else
|
#else
|
||||||
#error Unimplemented
|
#error Unimplemented Timer constructor
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ void Lib::Timer::Start() {
|
||||||
QueryPerformanceCounter(&c);
|
QueryPerformanceCounter(&c);
|
||||||
m_StartTime = c.QuadPart;
|
m_StartTime = c.QuadPart;
|
||||||
#else
|
#else
|
||||||
#error Unimplemented
|
#error Unimplemented Timer::Start()
|
||||||
#endif
|
#endif
|
||||||
m_is_timer_paused = false;
|
m_is_timer_paused = false;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ void Lib::Timer::Pause() {
|
||||||
QueryPerformanceCounter(&c);
|
QueryPerformanceCounter(&c);
|
||||||
m_PauseTime = c.QuadPart;
|
m_PauseTime = c.QuadPart;
|
||||||
#else
|
#else
|
||||||
#error Unimplemented
|
#error Unimplemented Timer::Pause()
|
||||||
#endif
|
#endif
|
||||||
m_is_timer_paused = true;
|
m_is_timer_paused = true;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ void Lib::Timer::Resume() {
|
||||||
QueryPerformanceCounter(&c);
|
QueryPerformanceCounter(&c);
|
||||||
current_time = c.QuadPart;
|
current_time = c.QuadPart;
|
||||||
#else
|
#else
|
||||||
#error Unimplemented
|
#error Unimplemented Timer::Resume()
|
||||||
#endif
|
#endif
|
||||||
m_StartTime += current_time - m_PauseTime;
|
m_StartTime += current_time - m_PauseTime;
|
||||||
m_is_timer_paused = false;
|
m_is_timer_paused = false;
|
||||||
|
@ -62,7 +62,7 @@ double Lib::Timer::GetTimeMsec() const {
|
||||||
QueryPerformanceCounter(&c);
|
QueryPerformanceCounter(&c);
|
||||||
current_time = c.QuadPart;
|
current_time = c.QuadPart;
|
||||||
#else
|
#else
|
||||||
#error Unimplemented
|
#error Unimplemented Timer::GetTimeMsec()
|
||||||
#endif
|
#endif
|
||||||
return 1000.0 * (static_cast<double>(current_time - m_StartTime)) / static_cast<double>(m_Frequency);
|
return 1000.0 * (static_cast<double>(current_time - m_StartTime)) / static_cast<double>(m_Frequency);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ double Lib::Timer::GetTimeSec() const {
|
||||||
QueryPerformanceCounter(&c);
|
QueryPerformanceCounter(&c);
|
||||||
current_time = c.QuadPart;
|
current_time = c.QuadPart;
|
||||||
#else
|
#else
|
||||||
#error Unimplemented
|
#error Unimplemented Timer::GetTimeSec()
|
||||||
#endif
|
#endif
|
||||||
return (static_cast<double>(current_time - m_StartTime)) / static_cast<double>(m_Frequency);
|
return (static_cast<double>(current_time - m_StartTime)) / static_cast<double>(m_Frequency);
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ u64 Lib::Timer::GetTicks() const {
|
||||||
QueryPerformanceCounter(&c);
|
QueryPerformanceCounter(&c);
|
||||||
current_time = c.QuadPart;
|
current_time = c.QuadPart;
|
||||||
#else
|
#else
|
||||||
#error Unimplemented
|
#error Unimplemented Timer::GetTicks()
|
||||||
#endif
|
#endif
|
||||||
return (current_time - m_StartTime);
|
return (current_time - m_StartTime);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue