vibe.d beta banner
get vibe.d

Asynchronous I/O that doesn’t get in your way, written in D

Function EventDriverTimers.wait

Waits for the timer to fire.

final abstract void wait (
  TimerID timer,
  nothrow @safe void delegate(TimerID) callback
) nothrow @safe;

abstract void wait (
  TimerID timer,
  nothrow @safe void delegate(TimerID, bool) callback
) nothrow @safe;


the callback of the timer will be called exactly once, unless cancelWait gets called first. wait needs to be called again to receive future timer events (see for reasons behind that behavior).

Note that the TimerCallback based overload will not call the callback if stop gets called before the timer fires, whereas the TimerCallback2 based overload will call the callback with the fired parameter set to false.