Struct spin_sleep::SpinSleeper
[−]
[src]
pub struct SpinSleeper { /* fields omitted */ }
Accuracy container for spin sleeping. See crate docs.
Methods
impl SpinSleeper
[src]
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.
fn native_accuracy_ns(&self) -> SubsecondNanoseconds
[src]
Returns configured native_accuracy_ns
fn sleep(&self, duration: Duration)
[src]
Puts the current thread to sleep and then/or spins until the specified duration has elapsed.
fn sleep_s(&self, seconds: Seconds)
[src]
Puts the current thread to sleep and then/or spins until the specified float second duration has elapsed.
fn sleep_ns(&self, nanoseconds: Nanoseconds)
[src]
Puts the current thread to sleep and then/or spins until the specified nanosecond duration has elapsed.
Trait Implementations
impl Debug for SpinSleeper
[src]
impl Clone for SpinSleeper
[src]
fn clone(&self) -> SpinSleeper
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for SpinSleeper
[src]
impl PartialEq for SpinSleeper
[src]
fn eq(&self, __arg_0: &SpinSleeper) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SpinSleeper) -> bool
[src]
This method tests for !=
.