Function spin_sleep::sleep [−][src]
pub fn sleep(duration: Duration)
Expand description
Puts the current thread to sleep, if duration is long enough, then spins until the specified nanosecond duration has elapsed.
Uses default native accuracy.
Convenience function for SpinSleeper::default().sleep(duration). Can directly take the
place of thread::sleep.
Windows: Automatically selects the best native sleep accuracy generally achieving ~1ms native sleep accuracy, instead of default ~16ms.