![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <timer.hpp>
Public Member Functions | |
Timer () noexcept | |
Timer (const Timer &timer) noexcept=default | |
Timer (Timer &&timer) noexcept=default | |
~Timer ()=default | |
Timer & | operator= (const Timer &timer) noexcept=default |
Timer & | operator= (Timer &&timer) noexcept=default |
void | Start () noexcept |
void | Stop () noexcept |
void | Restart () noexcept |
void | Resume () noexcept |
TimeIntervalSeconds | GetDeltaTime () noexcept |
TimeIntervalSeconds | GetTotalDeltaTime () noexcept |
const std::pair< TimeIntervalSeconds, TimeIntervalSeconds > | GetTime () noexcept |
Private Types | |
using | TimeStamp = typename ClockT::time_point |
using | TimeInterval = typename ClockT::duration |
Private Member Functions | |
void | ResetDeltaTime () noexcept |
void | UpdateDeltaTime () noexcept |
Private Attributes | |
ClockT | m_clock |
TimeStamp | m_last_timestamp |
TimeInterval | m_delta_time |
TimeInterval | m_total_delta_time |
bool | m_running |
A class of timers.
ClockT | The clock type. |
|
private |
The time interval type representing the interval between time points of timers.
|
private |
The time stamp type representing the time points of timers.
|
noexcept |
Constructs a timer.
|
defaultnoexcept |
Constructs a timer from the given timer.
[in] | timer | A reference to the timer to copy. |
|
defaultnoexcept |
Constructs a timer by moving the given timer.
[in] | timer | A reference to the timer to move. |
|
default |
Destructs this timer.
|
noexcept |
Returns the delta time (in seconds) of this timer.
|
noexcept |
Returns the delta and total delta time (in seconds) of this timer.
|
noexcept |
Returns the total delta time (in seconds) of this timer.
|
defaultnoexcept |
Copies the given timer to this timer.
[in] | timer | A reference to the timer to copy. |
|
defaultnoexcept |
Moves the given timer to this timer.
[in] | timer | A reference to the timer to move. |
|
privatenoexcept |
Resets the delta time, total delta time and last timestamp of this timer.
|
noexcept |
Restarts this timer.
|
noexcept |
Resumes this timer.
|
noexcept |
Starts this timer.
|
noexcept |
Stops this timer.
|
privatenoexcept |
Updates the delta time, total delta time and last timestamp of this timer.
|
private |
The clock of this timer.
|
private |
The delta time of this timer.
|
private |
The last timestamp of this timer.
|
private |
Flag indicating whether this timer is running.
|
private |
The total delta time of this timer.