pub struct PrecisionTimer { /* private fields */ }Expand description
High-resolution stopwatch for measuring sub-millisecond graph and computational operations.
Implementations§
Source§impl PrecisionTimer
impl PrecisionTimer
Sourcepub fn restart(&mut self) -> Duration
pub fn restart(&mut self) -> Duration
Resets the timer to the current instant and returns the elapsed duration.
Sourcepub fn elapsed_nanos(&self) -> u64
pub fn elapsed_nanos(&self) -> u64
Returns elapsed time in integer nanoseconds (10⁻⁹ seconds).
Sourcepub fn elapsed_micros_f64(&self) -> f64
pub fn elapsed_micros_f64(&self) -> f64
Returns elapsed time in fractional microseconds (e.g. 1.250 µs).
Sourcepub fn elapsed_millis_f64(&self) -> f64
pub fn elapsed_millis_f64(&self) -> f64
Returns elapsed time in fractional milliseconds (e.g. 0.015 ms instead of 0).
Sourcepub fn format_elapsed(&self) -> String
pub fn format_elapsed(&self) -> String
Formats the elapsed time as a readable string (e.g. “340 ns”, “12.45 µs”).
Sourcepub fn benchmark_fn<F: FnMut()>(iterations: usize, f: F) -> BenchmarkResult
pub fn benchmark_fn<F: FnMut()>(iterations: usize, f: F) -> BenchmarkResult
Runs a closure over N iterations to measure throughput without zero-ms truncation.
Trait Implementations§
Source§impl Clone for PrecisionTimer
impl Clone for PrecisionTimer
impl Copy for PrecisionTimer
Source§impl Debug for PrecisionTimer
impl Debug for PrecisionTimer
Auto Trait Implementations§
impl Freeze for PrecisionTimer
impl RefUnwindSafe for PrecisionTimer
impl Send for PrecisionTimer
impl Sync for PrecisionTimer
impl Unpin for PrecisionTimer
impl UnsafeUnpin for PrecisionTimer
impl UnwindSafe for PrecisionTimer
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.