# Time¶

group group_abstraction_rtos_time

APIs for getting the current time and waiting.

Unnamed Group

cy_rslt_t cy_rtos_get_time(cy_time_t *tval)

Gets time in milliseconds since RTOS start.

note

Since this is only 32 bits, it will roll over every 49 days, 17 hours, 2 mins, 47.296 seconds

Parameters

tval[out] Pointer to the struct to populate with the RTOS time

Returns

Time in milliseconds since the RTOS started.

cy_rslt_t cy_rtos_delay_milliseconds(cy_time_t num_ms)

Delay for a number of milliseconds.

Processing of this function depends on the minimum sleep time resolution of the RTOS. The current thread should sleep for the longest period possible which is less than the delay required, then makes up the difference with a tight loop.

Parameters

num_ms[in] The number of milliseconds to delay for

Returns

The status of the creation request. [CY_RSLT_SUCCESS, CY_RTOS_GENERAL_ERROR]