33 mStartTime = std::chrono::high_resolution_clock::now();
34 mCurrentTime = mStartTime;
35 mLastTime = mCurrentTime;
40 mLastTime = mCurrentTime;
41 mCurrentTime = std::chrono::high_resolution_clock::now();
44 appTime.
SetTotalAppTime( std::chrono::duration_cast<std::chrono::milliseconds>(mCurrentTime - mStartTime) );
45 appTime.
SetElapsedAppTime( std::chrono::duration_cast<std::chrono::milliseconds>(mCurrentTime - mLastTime) );
High-resolution clock for updating application time.
Provides time tracking for the application runtime.
void Reset()
Resets the clock to the current system time.
void UpdateAppTime(AppTime &appTime)
Updates the given AppTime instance with elapsed and total durations.
AppClock()
Constructs a new clock initialized with the current time.
const std::chrono::high_resolution_clock::time_point & CurrentTime() const
Returns the most recent recorded time (current frame).
const std::chrono::high_resolution_clock::time_point & LastTime() const
Returns the time recorded at the previous frame.
const std::chrono::high_resolution_clock::time_point & StartTime() const
Returns the timestamp when the clock was started.
Manages current, total, and elapsed time for the application.
void SetTotalAppTime(const std::chrono::milliseconds &totalAppTime)
Sets total accumulated application time.
void SetCurrentTime(const std::chrono::high_resolution_clock::time_point ¤tTime)
Sets the current high-resolution time point.
void SetElapsedAppTime(const std::chrono::milliseconds &elapsedAppTime)
Sets elapsed time since the last frame.