Skip to main content

measure

Function measure 

Source
pub fn measure<R>(f: impl FnOnce() -> R) -> (R, Stats)
Expand description

Measures the stack telemetry of an operation, returning its result alongside the Stats delta.

The counters describe what happened during the call; the gauges describe the process as it was when the call returned. Stats says which is which.

This is the whole-process view, and it only sees what threads report about themselves. To measure how deep this closure got, reach for measure_peak instead.