Std::Time
Sleeping, monotonic timing, and wall-clock time.
Module: Std::Time
rux
import Std::Time;
import Std::Io::PrintLine;
func Main() -> int {
let start = Time::TickMs();
Time::SleepMs(50u32);
PrintLine(Time::TickMs() - start); // ~50
return 0;
}WARNING
On macOS, Std::Time is currently a no-op stub: the sleep functions do nothing, TickMs returns 0, and LocalTime/UtcTime return a zeroed SystemTime. The clock thunks are not yet wired into the compiler.
Sleeping
| Function | Description |
|---|---|
SleepMs | Pause for a number of milliseconds. |
SleepSeconds | Pause for a number of seconds. |
SleepMinutes | Pause for a number of minutes. |
Timing
| Function | Description |
|---|---|
TickMs | Monotonic millisecond counter for measuring elapsed time. |
Wall-clock time
| Function | Description |
|---|---|
UtcTime | Current date and time in UTC. |
LocalTime | Current local date and time. |
SystemTime | The broken-down date/time struct these return. |