Lyricdev
GitHub

class Timer

pub class Timer

Timers, as channels a select can wait on.

Methods

pub static fn after(d: Duration): Channel<void>

Returns a channel that fires once, when d has passed: then it closes, so a receive from it answers null and a select's case on it runs. A detached task sleeps until then, which the program does not wait for.