A class for easily managing timers. More...
#include <timer.hpp>
Public Member Functions | |
timer (bool run=true) noexcept | |
Timer constructor. | |
void | reset () noexcept |
Reset the timer. | |
void | reset (std::chrono::high_resolution_clock::time_point time) noexcept |
reset the timer to a specific point in time. | |
unsigned int | micros () const noexcept |
Get the elapsed time in microseconds. | |
unsigned int | millis () const noexcept |
Get the elapsed time in milliseconds. | |
unsigned int | seconds () const noexcept |
Get the elapsed time in seconds. | |
unsigned int | minutes () const noexcept |
Get the elapsed time in minutes. | |
unsigned int | hours () const noexcept |
Get the elapsed time in minutes. | |
template<class Archive > | |
void | save (Archive &ar) const |
Serialization output. | |
template<class Archive > | |
void | load (Archive &ar) |
Serialization input. | |
A class for easily managing timers.
Because this class uses the chrono library, it requires at least C++11.
Timer constructor.
run | an optional parameter to decide whether the timer should start now. |
Get the elapsed time in minutes.
Serialization input.
ar | The input archive. |
Get the elapsed time in microseconds.
Get the elapsed time in milliseconds.
Get the elapsed time in minutes.
Serialization output.
ar | The output archive. |
Get the elapsed time in seconds.