Creates an initialized, but unarmed timer. You must call other methods later.
Create a timer with a callback when it triggers.
Sets a one-of timer that happens some time after the given timestamp, then destroys itself
A destructor is present on this object, but not explicitly documented in the source.
Stop and destroy the timer object.
You create a timer with an interval and a callback. It will continue to fire on the interval until it is destroyed.
auto timer = new Timer(50, { it happened!; }); timer.destroy();
Timers can only be expected to fire when the event loop is running and only once per iteration through the event loop.
Prior to December 9, 2020, a timer pulse set too high with a handler too slow could lock up the event loop. It now guarantees other things will get a chance to run between timer calls, even if that means not keeping up with the requested interval.
Originally part of arsd.simpledisplay, this code was integrated into arsd.core on May 26, 2024 (committed on June 10).
A timer that will trigger your function on a given interval.