Refresh time in each engine loop.
Recording the current time.
Calculate frmae time.
Calculate game time.
Setting current time.
Update frames.
Recording the current time.
Calculate frmae time.
Calculate game time.
Setting current time.
Update frames.
Definition at line 26 of file TimeStep.cpp.
27 {
29
33 const auto nowTime = std::chrono::high_resolution_clock::now();
34
38 m_FrameTime = std::chrono::duration<float, std::chrono::seconds::period>(nowTime -
m_LastTime).count();
39
43 m_GameTime = std::chrono::duration<float, std::chrono::seconds::period>(nowTime -
m_StartTime).count();
44
49
55 }
#define SPICES_PROFILE_ZONE
float m_FrameTime
time step(s) during frames.
std::chrono::steady_clock::time_point m_StartTime
Engine Start time.
std::chrono::steady_clock::time_point m_LastTime
Last frame time.
float m_GameTime
time step(s) since Engine Start.
uint64_t m_Frames
Frames since Engine Start.
References m_Frames.
Referenced by Spices::Application::Run().