Skip to main content
load(@std//time.axl, sleep, sleep_iter, monotonic, monotonic_ns, time)
function sleep
def sleep(ms: int) -> None
Blocks the current thread for ms milliseconds. Returns None. The sleep is synchronous; the calling task’s thread is parked for the full duration.

Examples

function sleep_iter
def sleep_iter(ms: int) -> typing.Iterable[int]
Returns an infinite iterator that yields a monotonically increasing integer every ms milliseconds. Each call to next sleeps for ms milliseconds, then returns the next tick (starting at 0). Use break to stop iteration.

Examples

function monotonic
def monotonic() -> float
Returns a monotonically non-decreasing time in seconds as a float. The reference epoch is fixed at process start, so values are only meaningful relative to other monotonic() readings within the same process. Suitable for measuring elapsed time.

Examples

function monotonic_ns
def monotonic_ns() -> int
Returns a monotonically non-decreasing time in nanoseconds as an int. The reference epoch is fixed at process start, so values are only meaningful relative to other monotonic_ns() readings within the same process. Higher precision than monotonic().

Examples

property time
time: struct(monotonic = function, monotonic_ns = function, sleep = function, sleep_iter = function)