zena:time
zena
import {…} from 'zena:time';
Classes
Instant
zena
final extension class Instant
A point on the monotonic clock: nanoseconds from an arbitrary origin, so only the distance between two instants is meaningful.
Methods
Duration
zena
final extension class Duration
A signed span of time, in nanoseconds.
Methods
Functions
sleep
zena
function sleep(d: Duration): Future<void>
A future that completes after at least d.
monotonic
zena
function monotonic(): Instant
The monotonic clock's reading.
Reads the clock directly rather than through the installed Clock:
only the parker path — sleep, park, wait — needs the installation,
and a clock read should not pay a registration check.
milliseconds
zena
function milliseconds(ms: i64): Duration
ms milliseconds as a Duration.
nanoseconds
zena
function nanoseconds(ns: i64): Duration
ns nanoseconds as a Duration.