use tokio::time::Instant; pub fn time_mounts(context: &str, timer: &mut Instant, mut mounter: T) where T: FnMut(), { mounter(); info!( "{} mounts took {}ms", context, timer.elapsed().as_nanos() as f64 / 1_000_000.0 ); *timer = Instant::now(); } pub fn time_section(timer: &mut Instant, context: &str) { info!( "{} took {}ms", context, timer.elapsed().as_nanos() as f64 / 1_000_000.0 ); *timer = Instant::now(); }