Class for clock. More...
#include <Clock.hpp>
Public Types | |
using | TimePoint = std::chrono::time_point<std::chrono::high_resolution_clock> |
Public Member Functions | |
Clock (const bool startNow=true) | |
~Clock ()=default | |
Clock (const Clock &)=delete | |
Clock & | operator= (const Clock &)=delete |
Clock (Clock &&)=delete | |
Clock & | operator= (Clock &&)=delete |
void | restart () |
void | pause () |
void | resume () |
float | getDeltaSeconds () const |
template<typename Duration = std::chrono::seconds> | |
auto | getElapsed () const |
Static Public Member Functions | |
static TimePoint | now () |
Private Types | |
using | Duration = std::chrono::high_resolution_clock::duration |
Private Attributes | |
TimePoint | m_start |
TimePoint | m_pausedTime |
Duration | m_pausedDuration |
bool | m_isPaused {false} |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Clock &clock) |
|
private |
using utl::Clock::TimePoint = std::chrono::time_point<std::chrono::high_resolution_clock> |
|
inlineexplicit |
|
default |
|
delete |
|
delete |
|
inlinenodiscard |
Definition at line 63 of file Clock.hpp.
References m_isPaused, m_pausedDuration, m_pausedTime, m_start, and now().
|
inlinenodiscard |
Definition at line 72 of file Clock.hpp.
References m_pausedDuration, m_start, and now().
|
inlinestatic |
Definition at line 40 of file Clock.hpp.
Referenced by getDeltaSeconds(), getElapsed(), pause(), restart(), and resume().
|
inline |
Definition at line 47 of file Clock.hpp.
References m_isPaused, m_pausedTime, and now().
|
inline |
Definition at line 41 of file Clock.hpp.
References m_isPaused, m_pausedDuration, m_start, and now().
|
inline |
Definition at line 55 of file Clock.hpp.
References m_isPaused, m_pausedDuration, m_pausedTime, and now().
|
friend |
|
private |
|
private |
Definition at line 82 of file Clock.hpp.
Referenced by getDeltaSeconds(), getElapsed(), restart(), and resume().
|
private |
Definition at line 81 of file Clock.hpp.
Referenced by getDeltaSeconds(), pause(), and resume().
|
private |
Definition at line 80 of file Clock.hpp.
Referenced by getDeltaSeconds(), getElapsed(), and restart().