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

Time

import std/time

Koru Standard Library: Time

time.kz · 8 tors · ~[comptime]· ~[runtime]

Koru Standard Library: Time Timing primitives for measuring code execution. Usage: import std/time import std/io std/time:now(): start |> do_work() |> std/time:elapsed(start: start): d |> std/io:print.ln("work: {{ d.ms:f }}ms")

sleep-ms

runtime koru_std/time.kz:91

sleep-s

runtime koru_std/time.kz:97

~part waits koru_std/time.waits.kz

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