Struct performance_timing::MeasureRegion [−][src]
pub struct MeasureRegion { /* fields omitted */ }
Expand description
Measure code block performance by collecting samples. It relies on the fact that objects get destroyed at the end of the block.
let mut loop_timing = MeasureRegion::new(); for _ in 0..N { let _ = loop_timing.get_sample(); foo(); } let cpu_cycles = loop_timing.get_average_sample() * CPUInfo::get_frequency_hz().tsc_scaling;
Implementations
impl MeasureRegion
[src]
impl MeasureRegion
[src]pub fn new_named(region_name: String, dump_on_drop: bool) -> Self
[src]
pub fn new() -> Self
[src]
pub fn get_sample(&mut self) -> MeasureSample<'_>
[src]
pub fn get_average_sample(&self) -> f32
[src]
pub fn get_total_time(&self) -> u64
[src]
pub fn get_total_time(&self) -> u64
[src]Get total running time in milliseconds
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MeasureRegion
impl Send for MeasureRegion
impl Sync for MeasureRegion
impl Unpin for MeasureRegion
impl UnwindSafe for MeasureRegion
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T