Skip to main content

Module time

Module time 

Source
Expand description

Time-related syscalls: clock_gettime, nanosleep, clock_nanosleep

Structs§

TimeSpec
POSIX-style timestamp: seconds + nanoseconds.

Constants§

CLOCK_MONOTONIC
Clock IDs for clock_gettime (POSIX-compatible subset)
CLOCK_REALTIME
TIMER_ABSTIME 🔒
Flag for clock_nanosleep: request is an absolute time based on the clock.

Functions§

current_time_ns
Get current monotonic time in nanoseconds since boot.
sys_clock_gettime
SYS_CLOCK_GETTIME: Get current time for the specified clock.
sys_clock_nanosleep
SYS_CLOCK_NANOSLEEP: Sleep with clock selection and absolute/relative mode.
sys_nanosleep
SYS_NANOSLEEP: Sleep for a specified duration.