std/timer
Scheduling primitives for delaying the current task.
Timer is separate from Instant and Duration: those modules describe
time values, while this module performs time-based waiting.
Import with import std/timer.
Exports
Section titled “Exports”Modules
module Timer
Section titled “module Timer”fn sleep(d: Duration): Unit
Suspends the current task for the given duration.
When called inside a concurrent { } block, cancellation of that block’s
context ends the sleep early without producing a user-visible error.