Module time

Source
Expand description

Time-related operations.

Structs§

Duration
A Duration type to represent a span of time, typically used for system timeouts.

Constants§

MICROS_PER_SEC
Number of microseconds in a second.
MILLIS_PER_SEC
Number of milliseconds in a second.
NANOS_PER_MICROS
Number of nanoseconds in a microsecond.
NANOS_PER_MILLIS
Number of nanoseconds in a millisecond.
NANOS_PER_SEC
Number of nanoseconds in a second.
TIMER_IRQ_NUMirq
The timer IRQ number.

Functions§

busy_wait
Busy waiting for the given duration.
busy_wait_until
Busy waiting until reaching the given deadline.
current_ticks
Returns the current clock time in hardware ticks.
epochoffset_nanos
Return epoch offset in nanoseconds (wall time offset to monotonic clock start).
monotonic_time
Returns the time elapsed since system boot in TimeValue.
monotonic_time_nanos
Returns nanoseconds elapsed since system boot.
nanos_to_ticks
Converts nanoseconds to hardware ticks.
set_oneshot_timerirq
Set a one-shot timer.
ticks_to_nanos
Converts hardware ticks to nanoseconds.
wall_time
Returns the time elapsed since epoch (also known as realtime) in TimeValue.
wall_time_nanos
Returns nanoseconds elapsed since epoch (also known as realtime).

Type Aliases§

TimeValue
A measurement of the system clock.