A class for easily managing timers.
More...
#include <timer.hpp>
|
| | 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 timers.
Because this class uses the chrono library, it requires at least C++11.
◆ timer()
| z::core::timer::timer |
( |
bool | run = true | ) |
|
|
noexcept |
Timer constructor.
- Parameters
-
| run | an optional parameter to decide whether the timer should start now. |
◆ hours()
| unsigned int z::core::timer::hours |
( |
| ) |
const |
|
noexcept |
Get the elapsed time in minutes.
- Returns
- The number of minutes that have passed since the timer was last reset.
◆ micros()
| unsigned int z::core::timer::micros |
( |
| ) |
const |
|
noexcept |
Get the elapsed time in microseconds.
- Returns
- The number of microseconds that have passed since the timer was last reset.
◆ millis()
| unsigned int z::core::timer::millis |
( |
| ) |
const |
|
noexcept |
Get the elapsed time in milliseconds.
- Returns
- The number of milliseconds that have passed since the timer was last reset.
◆ minutes()
| unsigned int z::core::timer::minutes |
( |
| ) |
const |
|
noexcept |
Get the elapsed time in minutes.
- Returns
- The number of minutes that have passed since the timer was last reset.
◆ seconds()
| unsigned int z::core::timer::seconds |
( |
| ) |
const |
|
noexcept |
Get the elapsed time in seconds.
- Returns
- The number of seconds that have passed since the timer was last reset.
The documentation for this class was generated from the following file: