Struct bitbazaar::timing::TimeRecorder
source · pub struct TimeRecorder { /* private fields */ }Expand description
A struct for recording time spent in various blocks of code.
Implementations§
source§impl TimeRecorder
impl TimeRecorder
sourcepub fn timeit<R, F: FnOnce() -> R>(&self, description: &str, f: F) -> R
pub fn timeit<R, F: FnOnce() -> R>(&self, description: &str, f: F) -> R
Time a block of code and log to the time recorder.
sourcepub fn total_elapsed(&self) -> Result<Duration, AnyErr>
pub fn total_elapsed(&self) -> Result<Duration, AnyErr>
Using from creation time rather than the specific durations recorded, to be sure to cover everything.
sourcepub fn format_verbose(&self) -> Result<String, AnyErr>
pub fn format_verbose(&self) -> Result<String, AnyErr>
Format the logs in a verbose, table format.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TimeRecorder
impl Send for TimeRecorder
impl Sync for TimeRecorder
impl Unpin for TimeRecorder
impl !UnwindSafe for TimeRecorder
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