pub struct Instant { /* private fields */ }Expand description
This struct is used to calculate the duration between two instant.
§Example
use perf_timer::Instant;
let start = Instant::now();
// ...
let duration = start.elapsed();Implementations§
Source§impl Instant
impl Instant
Sourcepub fn from_cpu_count(cpu_count: u64) -> Self
pub fn from_cpu_count(cpu_count: u64) -> Self
Create a new instant from a cpu count.
Sourcepub fn duration_since(&self, earlier: &Self) -> Duration
pub fn duration_since(&self, earlier: &Self) -> Duration
Return the amount of time from earlier adn this instant.
§Panic
This function will panic if earlier is not in the past.
Auto Trait Implementations§
impl Freeze for Instant
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