setTimer

Run an asynchronous task after a given time.

The task will first run after the given timeout, and can either repeat or run only once (the default). Works similarly to Vibe.d's setTimer.

nothrow
setTimer
(
Duration timeout
,
void delegate
()
dg
,
bool periodic = false
)

Parameters

timeout Duration

Determines the minimum amount of time that elapses before the timer fires.

dg void delegate
()

If non-null, this delegate will be called when the timer fires

periodic bool

Speficies if the timer fires repeatedly or only once

Return Value

Type: Timer

A Timer instance with the ability to control the timer

Meta