Zen API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
k64u kTimer_Spin ( k64u  duration)

Performs CPU busywork for at least the specified duration.

Thread sleep functions (e.g., kThread_Sleep kThread_SleepAtLeast) should usually be used to implement delays because they avoid wasting CPU cycles. However, if a very short (e.g., << 1 ms) delay is desired, thread sleep functions will likely result in longer delays than requested due to kernel timer resolutions. In most cases, this will not be problematic; however, if the excess delay incurred by thread sleeps is signficantly disadvantageous, kTimer_Spin can be used instead, with the caveat that it will waste CPU cycles for the duration of the specified delay.

Returns
Delay time, in microseconds.