pub struct Profiler { /* private fields */ }Implementations§
Source§impl Profiler
impl Profiler
pub fn register(&mut self, name: &str, budget: Duration) -> CounterId
Sourcepub fn try_register(
&mut self,
name: &str,
budget: Duration,
) -> Option<CounterId>
pub fn try_register( &mut self, name: &str, budget: Duration, ) -> Option<CounterId>
Existing names retain their initial budget. Names are 1..=128 UTF-8 bytes.
pub fn record(&mut self, id: CounterId, duration: Duration)
pub fn try_record(&mut self, id: CounterId, duration: Duration) -> bool
Sourcepub fn measure<T>(&mut self, id: CounterId, f: impl FnOnce() -> T) -> T
pub fn measure<T>(&mut self, id: CounterId, f: impl FnOnce() -> T) -> T
Native convenience. Browser callers supply performance.now through measure_with_clock.
pub fn measure_with_clock<T>( &mut self, id: CounterId, now: impl FnMut() -> Duration, f: impl FnOnce() -> T, ) -> T
pub fn summary(&self, id: CounterId) -> Summary
pub fn try_summary(&self, id: CounterId) -> Option<Summary>
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