Function core_extensions::measure_time::try_measure

source ยท
pub fn try_measure<F, T, E>(f: F) -> Result<(Duration, T), E>
where F: FnOnce() -> Result<T, E>,
Expand description

Measures the time taken by fallible function f to execute, returning a pair of Result<(Duration, T), E>, so that this function can be used in combination with ?.