Syntalos::WorkerTimer
Syntalos::WorkerTimer
A one-shot timer of an event-driven worker. More…
#include <moduleworker.h>
Public Functions
| Name | |
|---|---|
| WorkerTimer() =default | |
| void | start(const milliseconds_t & delay) const Have the timer fire once after the given delay. |
| void | start(const microseconds_t & delay) const |
| void | stop() const Cancel the timer, if it is waiting. |
Friends
| Name | |
|---|---|
| class | WorkerEvents |
Detailed Description
class Syntalos::WorkerTimer;A one-shot timer of an event-driven worker.
Created with WorkerEvents::timer() in the setup() function of a worker. The timer does nothing until it is started, and then calls its function once in the worker’s event loop. It can be started again at any time, also from within its own function. A default-constructed timer does nothing.
Public Functions Documentation
function WorkerTimer
WorkerTimer() =defaultfunction start
void start(
const milliseconds_t & delay
) constHave the timer fire once after the given delay.
If the timer is already waiting, it is set to the new delay. This has no effect while the event loop of the worker is not running.
function start
void start(
const microseconds_t & delay
) constfunction stop
void stop() constCancel the timer, if it is waiting.
Friends
friend WorkerEvents
friend class WorkerEvents(
WorkerEvents
);Updated on 2026-11-26 at 18:54:14 +0000