PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
Timer.hpp
1#pragma once
2
3namespace PixelBullet
4{
6 class Timer
7 {
8 public:
9 Timer();
10 ~Timer();
11
13 void Reset();
14
16 float GetElapsedSeconds() const;
17
19 float GetElapsedMilliseconds() const;
20
21 private:
22 // PImpl to hide std::chrono and other includes from the header.
23 struct Impl;
24 Impl* pImpl;
25 };
26} // namespace PixelBullet
A high-resolution timer for measuring elapsed time.
Definition Timer.hpp:7
float GetElapsedSeconds() const
Returns the elapsed time (in seconds) since the last Reset.
Definition Timer.cpp:28
float GetElapsedMilliseconds() const
Returns the elapsed time (in milliseconds) since the last Reset.
Definition Timer.cpp:35
void Reset()
Resets the timer to the current time.
Definition Timer.cpp:23
Definition Timer.cpp:8