Skip to main content

time

Function time 

Source
pub fn time<T>(step: &'static str, f: impl FnOnce() -> T) -> T
Expand description

Run f, recording its duration under step if init has been called.

Never holds the recorder lock across f, so a timed step may itself contain timed steps without deadlocking. Uninitialized (unit tests, the migrate subcommand, anything that never calls init) it is a transparent pass-through.