pub struct Profiler { /* private fields */ }Expand description
Profiler that tracks execution metrics
Implementations§
Source§impl Profiler
impl Profiler
pub fn new() -> Self
pub fn start(&mut self)
pub fn stop(&mut self)
Sourcepub fn time_op<F, R>(&mut self, op_type: impl Into<String>, f: F) -> Rwhere
F: FnOnce() -> R,
pub fn time_op<F, R>(&mut self, op_type: impl Into<String>, f: F) -> Rwhere
F: FnOnce() -> R,
Time an operation and record its duration
pub fn record_allocation(&mut self, bytes: usize)
pub fn record_deallocation(&mut self, bytes: usize)
pub fn data(&self) -> &ProfileData
pub fn into_data(self) -> ProfileData
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 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