pub fn time_and_record<T>(timer: &Timer, f: impl FnOnce() -> T) -> T
Time a function and record the duration in the provided timer