#include <PeriodicTimer.hpp>
Definition at line 13 of file PeriodicTimer.hpp.
msp::PeriodicTimer::PeriodicTimer |
( |
const std::function< void()> |
funct, |
|
|
const double |
period_seconds |
|
) |
| |
PeriodicTimer define a periodic timer.
- Parameters
-
funct | function that is called periodically |
period_seconds | period in seconds |
Definition at line 5 of file PeriodicTimer.cpp.
msp::PeriodicTimer::~PeriodicTimer |
( |
| ) |
|
|
inline |
double msp::PeriodicTimer::getPeriod |
( |
| ) |
const |
|
inline |
getPeriod get period in seconds
- Returns
- period in seconds
Definition at line 42 of file PeriodicTimer.hpp.
void msp::PeriodicTimer::setPeriod |
( |
const double & |
period_seconds | ) |
|
setPeriod change the update period of timer thread This will stop and restart the thread.
- Parameters
-
period_seconds | period in seconds |
Definition at line 55 of file PeriodicTimer.cpp.
bool msp::PeriodicTimer::start |
( |
| ) |
|
bool msp::PeriodicTimer::stop |
( |
| ) |
|
std::function<void()> msp::PeriodicTimer::funct |
|
private |
std::timed_mutex msp::PeriodicTimer::mutex_timer |
|
private |
std::chrono::duration<size_t, std::micro> msp::PeriodicTimer::period_us |
|
private |
std::atomic_flag msp::PeriodicTimer::running_ = ATOMIC_FLAG_INIT |
|
private |
std::shared_ptr<std::thread> msp::PeriodicTimer::thread_ptr |
|
private |
std::chrono::steady_clock::time_point msp::PeriodicTimer::tstart |
|
private |
The documentation for this class was generated from the following files: