|
R-Type
Distributed multiplayer game engine in C++
|
Utility class to measure frame durations. More...
#include <FrameTimer.hpp>

Public Member Functions | |
| FrameTimer ()=default | |
| ~FrameTimer ()=default | |
| void | reset () |
| Reset the timer to the current time. | |
| double | elapsed () const |
| Get the elapsed time in seconds since last reset. | |
| double | tick () |
| Get elapsed time and automatically reset (optimized for game loops) | |
Static Public Member Functions | |
| static void | sleepMilliseconds (int milliseconds) |
| Sleep for specified milliseconds (centralized time management) | |
Private Attributes | |
| std::chrono::steady_clock::time_point | _start {std::chrono::steady_clock::now()} |
Utility class to measure frame durations.
Provides a way to track elapsed time between frames.
Definition at line 21 of file FrameTimer.hpp.
|
default |
|
default |
|
inline |
Get the elapsed time in seconds since last reset.
Definition at line 35 of file FrameTimer.hpp.
References _start.
|
inline |
Reset the timer to the current time.
Definition at line 29 of file FrameTimer.hpp.
References _start.
Referenced by Server::run(), and server::ServerLoop::start().
|
inlinestatic |
Sleep for specified milliseconds (centralized time management)
| milliseconds | Duration to sleep |
Definition at line 56 of file FrameTimer.hpp.
Referenced by server::ServerLoop::_gameLoopThread(), ServerNetworkManager::networkThreadLoop(), and Server::run().
|
inline |
Get elapsed time and automatically reset (optimized for game loops)
Definition at line 45 of file FrameTimer.hpp.
References _start.
Referenced by server::ServerLoop::_gameLoopThread(), and Server::run().
|
private |
Definition at line 61 of file FrameTimer.hpp.