Generic thread functions.
These are C versions of functions provided in C++ via rtos::Thread and rtos::ThisThread Read the current RTOS kernel millisecond tick count. The tick count corresponds to the tick count the RTOS uses for timing purposes. It increments monotonically from 0 at boot, so it effectively never wraps. If the underlying RTOS only provides a 32-bit tick count, this method expands it to 64 bits.
- Returns
- RTOS kernel current tick count
- Note
- Mbed OS always uses millisecond RTOS ticks, and this could only wrap after half a billion years.
-
In a non-RTOS build, this computes an equivalent time in milliseconds, based on a HAL timer. The time may be referenced as 0 on first call.
-
You cannot call this function from ISR context.
-
The equivalent functionality is accessible in C++ via rtos::Kernel::get_ms_count.