pub struct Elapsed(/* private fields */);
Expand description
The difference between two timestamps.
Implementations§
source§impl Elapsed
impl Elapsed
sourcepub fn from_ticks(ticks: u64) -> Self
pub fn from_ticks(ticks: u64) -> Self
Builds a Duration
from a number of ticks
sourcepub fn as_secs(&self, precision: &Precision) -> u64
pub fn as_secs(&self, precision: &Precision) -> u64
Returns the duration as a number of seconds
§Panics
Panics if the given Precision
was not configured to measure wall time.
sourcepub fn as_secs_f64(&self, precision: &Precision) -> f64
pub fn as_secs_f64(&self, precision: &Precision) -> f64
Returns the duration as a number of seconds (floating-point)
§Panics
Panics if the given Precision
was not configured to measure wall time.
Trait Implementations§
source§impl AddAssign for Elapsed
impl AddAssign for Elapsed
source§fn add_assign(&mut self, other: Elapsed)
fn add_assign(&mut self, other: Elapsed)
Performs the
+=
operation. Read moresource§impl Ord for Elapsed
impl Ord for Elapsed
source§impl PartialEq for Elapsed
impl PartialEq for Elapsed
source§impl PartialOrd for Elapsed
impl PartialOrd for Elapsed
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 Elapsed
impl Eq for Elapsed
impl StructuralPartialEq for Elapsed
Auto Trait Implementations§
impl Freeze for Elapsed
impl RefUnwindSafe for Elapsed
impl Send for Elapsed
impl Sync for Elapsed
impl Unpin for Elapsed
impl UnwindSafe for Elapsed
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