Determines the minimum amount of time that elapses before the timer fires.
If non-null, this delegate will be called when the timer fires
Speficies if the timer fires repeatedly or only once
Returns a Timer object that can be used to identify and modify the timer.
void printTime() @safe nothrow { import std.datetime; logInfo("The time is: %s", Clock.currTime()); } void test() { import vibe.core.core; // start a periodic timer that prints the time every second setTimer(1.seconds, toDelegate(&printTime), true); }
createTimer
Returns a new armed timer.
Note that timers can only work if an event loop is running, explicitly or implicitly by running a blocking operation, such as sleep or File.read.