[][src]Macro sp_tracing::tracing_span

macro_rules! tracing_span {
    (
		$name:expr;
		$( $code:tt )*
	) => { ... };
}

Runs given code within a tracing span, measuring it's execution time.

If tracing is not enabled, the code is still executed.

Example

sp_tracing::tracing_span! {
    "test-span";
    1 + 1;
    // some other complex code
}