pub struct Profiler { /* private fields */ }Expand description
Performance profiler combining timing and memory tracking
Implementations§
Source§impl Profiler
impl Profiler
Sourcepub fn start_session(&mut self, name: String) -> UtilsResult<()>
pub fn start_session(&mut self, name: String) -> UtilsResult<()>
Start a profiling session
Sourcepub fn end_session(&mut self, name: &str) -> UtilsResult<ProfileResult>
pub fn end_session(&mut self, name: &str) -> UtilsResult<ProfileResult>
End a profiling session and record results
Sourcepub fn profile<F, R>(
&mut self,
name: String,
f: F,
) -> UtilsResult<(R, ProfileResult)>where
F: FnOnce() -> R,
pub fn profile<F, R>(
&mut self,
name: String,
f: F,
) -> UtilsResult<(R, ProfileResult)>where
F: FnOnce() -> R,
Profile a closure
Sourcepub fn memory(&self) -> &MemoryTracker
pub fn memory(&self) -> &MemoryTracker
Get memory tracker reference
Sourcepub fn report(&self) -> ProfileReport
pub fn report(&self) -> ProfileReport
Generate a performance report
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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