pub struct PerfUtils;Expand description
Performance measurement utilities
Implementations§
Source§impl PerfUtils
impl PerfUtils
Sourcepub fn measure_time<F, R>(f: F) -> (R, Duration)where
F: FnOnce() -> R,
pub fn measure_time<F, R>(f: F) -> (R, Duration)where
F: FnOnce() -> R,
Measure the time taken to execute a closure
Sourcepub fn calculate_throughput_mb_s(bytes: usize, duration: Duration) -> f64
pub fn calculate_throughput_mb_s(bytes: usize, duration: Duration) -> f64
Calculate throughput in MB/s
Sourcepub fn calculate_throughput_bytes_s(bytes: usize, duration: Duration) -> f64
pub fn calculate_throughput_bytes_s(bytes: usize, duration: Duration) -> f64
Calculate throughput in bytes/s
Auto Trait Implementations§
impl Freeze for PerfUtils
impl RefUnwindSafe for PerfUtils
impl Send for PerfUtils
impl Sync for PerfUtils
impl Unpin for PerfUtils
impl UnwindSafe for PerfUtils
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