Struct solana_sdk::timing::AtomicInterval
source · [−]pub struct AtomicInterval { /* private fields */ }
Implementations
sourceimpl AtomicInterval
impl AtomicInterval
sourcepub fn should_update(&self, interval_time_ms: u64) -> bool
pub fn should_update(&self, interval_time_ms: u64) -> bool
true if ‘interval_time_ms’ has elapsed since last time we returned true as long as it has been ‘interval_time_ms’ since this struct was created
sourcepub fn should_update_ext(&self, interval_time_ms: u64, skip_first: bool) -> bool
pub fn should_update_ext(&self, interval_time_ms: u64, skip_first: bool) -> bool
a primary use case is periodic metric reporting, potentially from different threads true if ‘interval_time_ms’ has elapsed since last time we returned true except, if skip_first=false, false until ‘interval_time_ms’ has elapsed since this struct was created
sourcepub fn elapsed_ms(&self) -> u64
pub fn elapsed_ms(&self) -> u64
return ms elapsed since the last time the time was set
sourcepub fn remaining_until_next_interval(&self, interval_time: u64) -> u64
pub fn remaining_until_next_interval(&self, interval_time: u64) -> u64
return ms until the interval_time will have elapsed
Trait Implementations
sourceimpl Debug for AtomicInterval
impl Debug for AtomicInterval
sourceimpl Default for AtomicInterval
impl Default for AtomicInterval
sourcefn default() -> AtomicInterval
fn default() -> AtomicInterval
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for AtomicInterval
impl Send for AtomicInterval
impl Sync for AtomicInterval
impl Unpin for AtomicInterval
impl UnwindSafe for AtomicInterval
Blanket Implementations
sourceimpl<T> AbiExample for T
impl<T> AbiExample for T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more