38 void start(std::chrono::microseconds interval, std::function<
void()> callback);
43 void start(std::chrono::microseconds interval,
44 std::function<
void()> callback,
51 bool is_running()
const {
return running_.load(std::memory_order_relaxed); }
64 std::atomic<bool> running_{
false};
67 std::shared_ptr<TimerState> state_;
69 void* dispatch_source_ =
nullptr;
TimerMode active_mode() const
The backend actually in use for the current run (may differ from the requested mode when the platform...
Definition high_resolution_timer.hpp:55
HighResolutionTimer(const HighResolutionTimer &)=delete
HighResolutionTimer()=default
bool is_running() const
Whether the timer is currently running.
Definition high_resolution_timer.hpp:51
void stop()
Stop the timer.
void start(std::chrono::microseconds interval, std::function< void()> callback)
Start the timer with the given interval. Callback runs on a dedicated thread.
HighResolutionTimer & operator=(const HighResolutionTimer &)=delete
void start(std::chrono::microseconds interval, std::function< void()> callback, TimerMode mode)
Start the timer in the requested mode.
Definition generated_event_source.hpp:33
TimerMode
Backend selection for the high-resolution timer.
Definition high_resolution_timer.hpp:27
@ OsTimerQueue
Definition high_resolution_timer.hpp:29
@ DedicatedThread
Definition high_resolution_timer.hpp:28