This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 9/16/2026.

Time.waits

~import std/time.waits

Koru Standard Library: the `waits` part of time.kz.

time.waits.kz · 3 tors

Koru Standard Library: the `waits` part of time.kz. · 23 more lines
Koru Standard Library: the `waits` part of time.kz. Joined via `~part waits` in time.kz; merged into the module at load. PUMP WAITS What a `std/pump:run` `! idle` arm reaches for. Three shapes because a dead pass is waited three honest ways: sleep-us — a fixed wait finer than sleep-ms, for a sub-millisecond spin budget on a busy machine. sleep-until — wait to a monotonic deadline (same `now()` epoch). A deadline, not a duration: composable with anything that knows when it next wants to run. pace — the frame-pacer. `last` is the boundary you last waited to (start at `std/time:now()`); `pace` sleeps until `last + period` and returns that boundary, so the next call paces off the SCHEDULE, not off when the kernel happened to wake you — a 60 Hz `! tick` that never drifts. ! idle |> std/time:sleep-ms(ms: 2) ! idle |> std/time:pace(period: 16_666_667, last: tick_ns): tick_ns Sleep for specified microseconds

sleep-us

runtime koru_std/time.waits.kz:26

sleep-until

runtime koru_std/time.waits.kz:35