macro_rules! span {
() => { ... };
($name: expr) => { ... };
($name: expr, $callstack_depth: expr) => { ... };
}
Expand description
Start a new Tracy span with function, file, and line determined automatically.
§Panics
span!
will panic if the Client isn’t running at the time this macro is invoked.
§Examples
Begin a span region, which will be terminated once _span
goes out of scope:
use tracy_client::{Client, span};
let _span = span!("some span");
It is also possible to enable collection of the callstack by specifying a limit of call stack frames to record:
use tracy_client::span;
let _span = span!("some span", 32);
Note, however, that collecting callstack introduces a non-trivial overhead at the point of instrumentation.