pub struct BenchTimer { /* private fields */ }Expand description
A simple stopwatch for benchmark timing.
Records the start time on creation and provides elapsed time queries.
§Validation
- VAL-INFRA-013: Benchmark timing utilities (elapsed calculation, formatting)
Implementations§
Source§impl BenchTimer
impl BenchTimer
Sourcepub fn start(label: &str) -> Self
pub fn start(label: &str) -> Self
Create a new timer with the given label, starting immediately.
Sourcepub fn start_default() -> Self
pub fn start_default() -> Self
Create a new timer with label “benchmark”.
Sourcepub fn elapsed_ms(&self) -> u128
pub fn elapsed_ms(&self) -> u128
Return elapsed time in milliseconds.
Sourcepub fn elapsed_secs(&self) -> f64
pub fn elapsed_secs(&self) -> f64
Return elapsed time in seconds (floating point).
Trait Implementations§
Source§impl Clone for BenchTimer
impl Clone for BenchTimer
Auto Trait Implementations§
impl Freeze for BenchTimer
impl RefUnwindSafe for BenchTimer
impl Send for BenchTimer
impl Sync for BenchTimer
impl Unpin for BenchTimer
impl UnsafeUnpin for BenchTimer
impl UnwindSafe for BenchTimer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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