A class for easily managing timing. More...
#include <timeout.hpp>
Public Member Functions | |
timeout (unsigned int timeout_micros=-1, bool run=true) noexcept | |
Timeout constructor. | |
void | setTimeOut (unsigned int timeout_micros) noexcept |
Set the time out goal. | |
bool | timedOut () const noexcept |
Check whether the timer has timed out. | |
template<class Archive > | |
void | save (Archive &ar) const |
Serialization output. | |
template<class Archive > | |
void | load (Archive &ar) |
Serialization input. | |
![]() | |
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 timing.
An extended version of the timer class which includes a timeout boundary.
Timeout constructor.
timeout_micros | the number of microseconds after which the timer will time out. If this is set to a negative value, then it will never time out. |
run | an optional parameter to decide whether the timer should start now. |
Serialization input.
ar | The input archive. |
Serialization output.
ar | The output archive. |
Set the time out goal.
timeout_micros | the number of microseconds after which the timer will time out. If this is set to a negative value, then it will never time out. |
|
noexcept |
Check whether the timer has timed out.