#[repr(align(64))]pub struct Timer { /* private fields */ }
Expand description
High-precision timer with automatic statistics
Optimized for sub-10ns timing operations. Cache-line aligned to prevent false sharing.
Implementations§
Source§impl Timer
impl Timer
Sourcepub fn start(&self) -> RunningTimer<'_>
pub fn start(&self) -> RunningTimer<'_>
Start timing - returns RAII guard that auto-records on drop
Sourcepub fn record_batch(&self, durations: &[Duration])
pub fn record_batch(&self, durations: &[Duration])
Record multiple durations at once
Sourcepub fn stats(&self) -> TimerStats
pub fn stats(&self) -> TimerStats
Get comprehensive statistics
Sourcepub fn rate_per_second(&self) -> f64
pub fn rate_per_second(&self) -> f64
Get samples per second rate
Trait Implementations§
Source§impl AsyncTimerExt for Timer
impl AsyncTimerExt for Timer
Source§fn start_async(&self) -> AsyncTimerGuard<'_>
fn start_async(&self) -> AsyncTimerGuard<'_>
Start an async-aware timer
Source§fn time_async<F, Fut, T>(&self, f: F) -> TimedFuture<'_, Fut>
fn time_async<F, Fut, T>(&self, f: F) -> TimedFuture<'_, Fut>
Time an async function
impl Send for Timer
impl Sync for Timer
Auto Trait Implementations§
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