pub struct Profiler { /* private fields */ }Expand description
Profiler state
Implementations§
Source§impl Profiler
impl Profiler
pub fn new() -> Self
Sourcepub fn enter_function(&mut self, name: &str)
pub fn enter_function(&mut self, name: &str)
Start profiling a function call
Sourcepub fn exit_function(&mut self, name: &str)
pub fn exit_function(&mut self, name: &str)
End profiling a function call
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if profiling is enabled
Sourcepub fn total_time(&self) -> f64
pub fn total_time(&self) -> f64
Get total time across all functions
Sourcepub fn functions_by_self(&self) -> Vec<&ProfFunc>
pub fn functions_by_self(&self) -> Vec<&ProfFunc>
Get functions sorted by self time (descending)
Sourcepub fn functions_by_total(&self) -> Vec<&ProfFunc>
pub fn functions_by_total(&self) -> Vec<&ProfFunc>
Get functions sorted by total time (descending)
Sourcepub fn arcs_by_time(&self) -> Vec<&ProfArc>
pub fn arcs_by_time(&self) -> Vec<&ProfArc>
Get arcs sorted by time (descending)
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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