16 PeriodicAction::PeriodicAction(
callback_t callback, std::chrono::milliseconds period_duration,
bool autostart )
17 : m_callback{ std::move(
callback ) }, m_period_duration{ period_duration } {
18 if ( autostart )
start();
29 auto next_call = clock::now() + period_duration;
30 while ( stop_signal.wait_until( next_call ) == std::future_status::timeout ) {
34 const auto now = clock::now();
35 while ( next_call < now ) next_call += period_duration;