35 m_startTick = std::chrono::steady_clock::now();
55 m_stopTick = std::chrono::steady_clock::now();
66 m_startTick = std::chrono::steady_clock::now();
68 m_startTick = m_stopTick;
79 std::chrono::duration<float> elapsed;
82 elapsed = std::chrono::steady_clock::now() - m_startTick;
84 elapsed = m_stopTick - m_startTick;
86 return elapsed.count();
97 std::chrono::duration<float, std::milli> elapsed;
100 elapsed = std::chrono::steady_clock::now() - m_startTick;
102 elapsed = m_stopTick - m_startTick;
104 return elapsed.count();
108 std::chrono::time_point<std::chrono::steady_clock> m_startTick;
109 std::chrono::time_point<std::chrono::steady_clock> m_stopTick;
110 bool m_isRunning =
false;
Definition: Stopwatch.h:14
void Start()
Record start time and change state to running, only if the stopwatch is stopped.
Definition: Stopwatch.h:42
float GetElapsedMilliseconds() const
Retrieve time elapsed between the last call to Start(), StartZero() or Reset() and; if running...
Definition: Stopwatch.h:95
float GetElapsedSeconds() const
Retrieve time elapsed between the last call to Start(), StartZero() or Reset() and; if running...
Definition: Stopwatch.h:77
void Stop()
Record stop time and change state to not running.
Definition: Stopwatch.h:51
void Reset()
Set the start time such that time elapsed is now zero.
Definition: Stopwatch.h:63
bool IsRunning() const
Retrieve the running state of the stopwatch.
Definition: Stopwatch.h:25
void StartZero()
Record start time and change state to running.
Definition: Stopwatch.h:33