clock
Use mono_nanos to measure durations and wall_nanos for the time of day.
For dates, time zones and formatting, use the coil-time
package.
Built into the compiler.
Import what you use (use path::* is not allowed):
use clock::{wall_nanos, mono_nanos};
Functions#
| Name | Description |
|---|---|
wall_nanos | Returns the current wall-clock time in nanoseconds since the Unix epoch (UTC). |
mono_nanos | Returns monotonic nanoseconds from a process-local starting point. |
sleep_ms | Pauses for at least ms milliseconds. |