Struct spin_sleep::SpinSleeper [−][src]
pub struct SpinSleeper { /* fields omitted */ }
Accuracy container for spin sleeping. See crate docs.
Implementations
impl SpinSleeper
[src][−]
pub fn new(native_accuracy_ns: SubsecondNanoseconds) -> SpinSleeper
[src][−]
Constructs new SpinSleeper with the input native sleep accuracy.
The lower the native_accuracy_ns
the more we effectively trust the accuracy of the
thread::sleep
function.
pub fn native_accuracy_ns(self) -> SubsecondNanoseconds
[src][−]
Returns configured native_accuracy_ns
pub fn sleep(self, duration: Duration)
[src][−]
Puts the current thread to sleep, if duration is long enough, then spins until the specified duration has elapsed.
Windows: Automatically selects the best native sleep accuracy generally achieving ~1ms native sleep accuracy, instead of default ~16ms.
pub fn sleep_s(self, seconds: Seconds)
[src][−]
Puts the current thread to sleep, if duration is long enough, then spins until the specified second duration has elapsed.
Windows: Automatically selects the best native sleep accuracy generally achieving ~1ms native sleep accuracy, instead of default ~16ms.
pub fn sleep_ns(self, nanoseconds: Nanoseconds)
[src][−]
Puts the current thread to sleep, if duration is long enough, then spins until the specified nanosecond duration has elapsed.
Windows: Automatically selects the best native sleep accuracy generally achieving ~1ms native sleep accuracy, instead of default ~16ms.
Trait Implementations
impl Clone for SpinSleeper
[src][+]
impl Copy for SpinSleeper
[src]
impl Debug for SpinSleeper
[src][+]
impl Default for SpinSleeper
[src][+]
impl Eq for SpinSleeper
[src]
impl Hash for SpinSleeper
[src][+]
impl PartialEq<SpinSleeper> for SpinSleeper
[src][+]
impl StructuralEq for SpinSleeper
[src]
impl StructuralPartialEq for SpinSleeper
[src]
Auto Trait Implementations
impl RefUnwindSafe for SpinSleeper
impl Send for SpinSleeper
impl Sync for SpinSleeper
impl Unpin for SpinSleeper
impl UnwindSafe for SpinSleeper
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,