Trait time::EarlySleeper

source ·
pub trait EarlySleeper: ClockSource<ClockType = Monotonic> {
    // Provided method
    fn sleep(duration: Duration) { ... }
}
Expand description

A hardware clock that can sleep without relying on interrupts.

Provided Methods§

source

fn sleep(duration: Duration)

Wait for the given duration.

This function spins the current task rather than sleeping it and so, when possible, the sleep crate should be used.

However, unlike the sleep crate, this function doesn’t rely on interrupts, and can be used prior to the scheduler being initiated.

Note to Implementors

The default implementation of this function uses ClockSource::now - it can only be used if ClockSource::now doesn’t rely on interrupts.

Implementors§