Skip to main content

timing_scope

Macro timing_scope 

Source
macro_rules! timing_scope {
    ($name:literal) => { ... };
    (trace, $name:literal) => { ... };
}
Expand description

Measure elapsed time until explicit completion or drop, without entering a tracing span.

finish() means the measured work returned, including an ordinary error result. Dropping the guard without finishing records an interrupted sample, including cancellation and early exits. Use the trace form for hot per-file scopes enabled by --timings-detail.

let scope = common::timing_scope!("operation");
// perform work, including async work, without holding an entered span guard
scope.finish();