pub struct ProfileGuard { /* private fields */ }๐Deprecated since 0.9.5:
Use profile_scope!() macro instead
Expand description
RAII guard for timing a scope (legacy API).
Records the elapsed time to a histogram when dropped.
This is the original profiling mechanism that records directly to
the MetricsRegistry. For new code, prefer ProfileScope with
the Profiler trait.
ยงExample
โ
use reovim_kernel::debug::ProfileGuard;
fn expensive_operation() {
let _guard = ProfileGuard::new("expensive_operation");
// ... do work ...
} // time recorded to histogram when guard dropsImplementationsยง
Trait Implementationsยง
Auto Trait Implementationsยง
impl Freeze for ProfileGuard
impl RefUnwindSafe for ProfileGuard
impl Send for ProfileGuard
impl Sync for ProfileGuard
impl Unpin for ProfileGuard
impl UnsafeUnpin for ProfileGuard
impl UnwindSafe for ProfileGuard
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