Struct elfo_utils::time::Instant
source · pub struct Instant(/* private fields */);
Expand description
A measurement of a monotonically nondecreasing clock.
Implementations§
source§impl Instant
impl Instant
sourcepub fn elapsed(&self) -> Duration
pub fn elapsed(&self) -> Duration
Returns the amount of time elapsed since this instant.
Prefer secs_f64_since()
if used for metrics.
pub fn duration_since(&self, earlier: Self) -> Duration
pub fn secs_f64_since(&self, earlier: Self) -> f64
pub fn nanos_since(&self, earlier: Self) -> u64
Trait Implementations§
source§impl Ord for Instant
impl Ord for Instant
source§impl PartialEq for Instant
impl PartialEq for Instant
source§impl PartialOrd for Instant
impl PartialOrd for Instant
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Instant
impl Eq for Instant
impl StructuralEq for Instant
impl StructuralPartialEq for Instant
Auto Trait Implementations§
impl RefUnwindSafe for Instant
impl Send for Instant
impl Sync for Instant
impl Unpin for Instant
impl UnwindSafe for Instant
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more