macro_rules! duration { ($category:expr, $name:expr $(, $key:expr => $val:expr)* $(,)?) => { ... }; }
Expand description
Convenience macro for the duration
function that can be used to trace
the duration of a scope. If you need finer grained control over when a
duration starts and stops, see duration_begin
and duration_end
.
Example:
{
duration!(c"foo", c"bar", "x" => 5, "y" => 10);
...
...
// event will be recorded on drop.
}
is equivalent to
{
let args = [ArgValue::of("x", 5), ArgValue::of("y", 10)];
let _scope = duration(c"foo", c"bar", &args);
...
...
// event will be recorded on drop.
}