stratus::infra::metrics

Function timed

Source
pub fn timed<F, T>(f: F) -> Timed<T>
where F: FnOnce() -> T,
Expand description

Measures how long the provided function takes to execute.

Returns a wrapper that allows to using it to record metrics if the metrics feature is enabled.