Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 554 Bytes

File metadata and controls

23 lines (18 loc) · 554 Bytes

Standard Library: std::time

Overview

High-resolution timers, duration measurement, and fiber sleep.


Functions

clock_ms() -> Float

Returns high-resolution monotonic millisecond timestamp since process start.

let start = clock_ms();
# execute task
let elapsed = clock_ms() - start;
println("Duration: " + to_string(elapsed) + " ms");

sleep(milliseconds: Int) -> Nil

Suspends execution of the current fiber for the specified duration without blocking underlying OS threads.

sleep(500); # 0.5s pause