oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Functions
Time

High-resolution timestamps and blocking delay utilities. More...

Functions

int ove_time_get_us (uint64_t *out)
 Get the current monotonic time in microseconds.
 
int ove_time_get_ns (uint64_t *out)
 Get the current monotonic time in nanoseconds.
 
void ove_time_delay_ms (uint32_t ms)
 Block the calling task for at least ms milliseconds.
 
void ove_time_delay_us (uint32_t us)
 Block the calling task for at least us microseconds.
 

Detailed Description

High-resolution timestamps and blocking delay utilities.

Provides monotonic time queries at microsecond and nanosecond resolution, as well as blocking delay functions for both millisecond and microsecond granularities.

Timestamp values are monotonically non-decreasing from an arbitrary epoch (typically system boot). The actual resolution is backend-dependent and may be coarser than the unit implies on some platforms.

Note
Requires CONFIG_OVE_TIME.

Function Documentation

◆ ove_time_get_us()

int ove_time_get_us ( uint64_t *  out)

Get the current monotonic time in microseconds.

Reads the system timer and writes the elapsed microseconds since an arbitrary epoch (typically boot) to out.

Parameters
[out]outReceives the current timestamp in microseconds.
Returns
OVE_OK on success, negative error code on failure.
Note
Requires CONFIG_OVE_TIME.

◆ ove_time_get_ns()

int ove_time_get_ns ( uint64_t *  out)

Get the current monotonic time in nanoseconds.

Reads the system timer and writes the elapsed nanoseconds since an arbitrary epoch (typically boot) to out. Actual nanosecond resolution depends on the hardware timer; values may be rounded to the nearest tick.

Parameters
[out]outReceives the current timestamp in nanoseconds.
Returns
OVE_OK on success, negative error code on failure.
Note
Requires CONFIG_OVE_TIME.

◆ ove_time_delay_ms()

void ove_time_delay_ms ( uint32_t  ms)

Block the calling task for at least ms milliseconds.

Suspends the current task for a minimum of ms milliseconds. The actual sleep duration may be longer due to scheduling granularity and system load. Passing 0 yields the CPU to any equal or higher-priority task.

Parameters
[in]msMinimum delay in milliseconds.
Note
Requires CONFIG_OVE_TIME. Must not be called from an ISR.

◆ ove_time_delay_us()

void ove_time_delay_us ( uint32_t  us)

Block the calling task for at least us microseconds.

Suspends the current task for a minimum of us microseconds. For very short delays the implementation may busy-wait rather than yield, depending on the RTOS tick resolution.

Parameters
[in]usMinimum delay in microseconds.
Note
Requires CONFIG_OVE_TIME. Must not be called from an ISR.