Macro time_graph::spanned[][src]

macro_rules! spanned {
    ($name: expr, $block: expr) => { ... };
}

Run a block of code inside a new span

This macro creates a new CallSite with the given name at the current source location, and record the provided code execution by running it inside a Span.

Examples

use time_graph::spanned;

let result = spanned!("named", {
    let first = 30;
    let second = 12;
    first + second
});

assert_eq!(result, 42);