Listener.timer

Start a timer.

class Listener
@safe @trusted
timer
(
void delegate
()
@safe
func
,
Duration duration
,
bool isRepeat = false
)

Parameters

func void delegate
()
@safe

The function to call when the timer expires.

duration Duration

Timer duration.

isRepeat bool

Whether to repeat the timer.

Return Value

Type: Timer*

A pointer to a timer.

Examples

listener.timer({
    writeln("3 seconds!");
},dur!"msecs"(3000),true);

Meta