pub struct Profiler { /* private fields */ }Expand description
A lightweight profiler that tracks operation timings
Implementations§
Source§impl Profiler
impl Profiler
Sourcepub fn time<F, R>(&mut self, operation: &str, f: F) -> Rwhere
F: FnOnce() -> R,
pub fn time<F, R>(&mut self, operation: &str, f: F) -> Rwhere
F: FnOnce() -> R,
Time a closure and record the result
Sourcepub fn time_n<F>(&mut self, operation: &str, iterations: usize, f: F)where
F: FnMut(),
pub fn time_n<F>(&mut self, operation: &str, iterations: usize, f: F)where
F: FnMut(),
Time a closure N times and record all results
Sourcepub fn stats(&self, operation: &str) -> Option<ProfileStats>
pub fn stats(&self, operation: &str) -> Option<ProfileStats>
Get statistics for a specific operation
Sourcepub fn all_stats(&self) -> Vec<ProfileStats>
pub fn all_stats(&self) -> Vec<ProfileStats>
Get statistics for all operations
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Profiler
impl RefUnwindSafe for Profiler
impl Send for Profiler
impl Sync for Profiler
impl Unpin for Profiler
impl UnsafeUnpin for Profiler
impl UnwindSafe for Profiler
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