A class for easily managing timing.
More...
#include <timeout.hpp>
|
| | 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.
|
| | 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.
|
A class for easily managing timing.
An extended version of the timer class which includes a timeout boundary.
◆ timeout()
| z::core::timeout::timeout |
( |
unsigned int | timeout_micros = -1, |
|
|
bool | run = true ) |
|
noexcept |
Timeout constructor.
- Parameters
-
| 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. |
◆ setTimeOut()
| void z::core::timeout::setTimeOut |
( |
unsigned int | timeout_micros | ) |
|
|
noexcept |
Set the time out goal.
- Parameters
-
| 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. |
◆ timedOut()
| bool z::core::timeout::timedOut |
( |
| ) |
const |
|
noexcept |
Check whether the timer has timed out.
- Returns
- True if the timer has passed the specified time limit. False otherwise.
The documentation for this class was generated from the following file: