Skip to main content

sleep_us

Function sleep_us 

Source
pub fn sleep_us(ctx: &ServiceContext, us: u64)
Expand description

Sleep for us microseconds, at the kernel’s resolution.

The kernel’s sleep ends on a scheduler tick on every port but ARMv7 (the Pi 2), which has a sub-tick timer for sleeps under a quantum and falls back to the tick when its few slots are taken; elsewhere anything under a quantum becomes a quantum. This is for a pace written in microseconds, not a hardware hold - a hold that must not be cut short or stretched belongs to gs::driver::delay. On a machine whose clock the kernel could not calibrate it is one quantum, the same floor sleep_ms has there.