The MonitorTimer keeps track of the time when to emit monitor data.
More...
#include <monitor.hh>
|
using | Clock = std::chrono::high_resolution_clock |
| Data type for the clock. More...
|
|
using | Time = std::chrono::high_resolution_clock::time_point |
| Data type for a time point. More...
|
|
using | DurationType = std::chrono::duration< double > |
| Data type for the time unit. More...
|
|
The MonitorTimer keeps track of the time when to emit monitor data.
◆ Clock
◆ DurationType
Data type for the time unit.
◆ Time
Data type for a time point.
◆ MonitorTimer()
Utopia::DataIO::MonitorTimer::MonitorTimer |
( |
const double |
emit_interval | ) |
|
|
inline |
Constructor.
Construct a new Monitor Timer object. The _last_emit time is set to the time of construction.
- Parameters
-
emit_interval | The time interval that defines whether the time has come to emit data. If more time than the _emit_interval has passed the time_has_come function returns true. |
◆ get_emit_interval()
const DurationType Utopia::DataIO::MonitorTimer::get_emit_interval |
( |
| ) |
const |
|
inline |
Return the emit interval.
◆ get_time_elapsed()
template<class DurationT = DurationType>
const DurationT Utopia::DataIO::MonitorTimer::get_time_elapsed |
( |
| ) |
const |
|
inline |
Get the time elapsed since the start of this timer.
◆ get_time_elapsed_seconds()
double Utopia::DataIO::MonitorTimer::get_time_elapsed_seconds |
( |
| ) |
const |
|
inline |
Get the time elapsed since start of this timer, converted to seconds.
◆ reset()
void Utopia::DataIO::MonitorTimer::reset |
( |
| ) |
|
|
inline |
Reset the timer to the current time.
◆ time_has_come()
bool Utopia::DataIO::MonitorTimer::time_has_come |
( |
| ) |
const |
|
inline |
Check for whether the time to emit has come or not.
- Parameters
-
reset | Reset the internal timer to the current time if the _emit_interval has been exceeded. |
- Returns
- true if the internal timer has exceeded the _last_emit time.
◆ _emit_interval
const DurationType Utopia::DataIO::MonitorTimer::_emit_interval |
|
private |
◆ _last_emit
Time Utopia::DataIO::MonitorTimer::_last_emit |
|
private |
The time of the last emit.
◆ _start_time
const Time Utopia::DataIO::MonitorTimer::_start_time |
|
private |
The starting time of the timer.
The documentation for this class was generated from the following file: