Functions | |
unsigned long | os_current_time_ms (void) |
int | os_sleep_ms (unsigned ms) |
int | os_delay_us (unsigned us) |
bool | os_time_after (unsigned long a, unsigned long b) |
unsigned long os_current_time_ms | ( | void | ) |
Return the current time (since an arbitrary point) in milliseconds.
The resolution depends on the OS but would typically be 10 ms or better.
Callable from: any context.
int os_delay_us | ( | unsigned | us | ) |
Delay a minimum length of time.
This may busy-wait and should not be used for long delays (use os_sleep_ms() instead).
Callable from: any context.
us | minimum time to delay (in us). |
int os_sleep_ms | ( | unsigned | ms | ) |
Sleep for a minimum length of time.
Callable from: thread context.
ms | minimum time to sleep (in ms). |
bool os_time_after | ( | unsigned long | a, | |
unsigned long | b | |||
) |
Check if some time has elapsed.
Callable from: any context.
a | a time returned by os_current_time_ms(). | |
b | a time returned by os_current_time_ms(). |