macro_rules! monitor_scoped {
($name:literal, $body:block) => { ... };
}Expand description
Macro to monitor a code scope with Rustmeter Beacon.
§Parameters
- $name: A string literal representing the name of the scope to be monitored (max 20 characters).
- $body: A block of code representing the scope to be monitored. Must be synchronous.
§Examples
fn matrix_multiply(a: &Matrix, b: &Matrix) -> Matrix {
// prepare or anything
let result = monitor_scoped!("matrix_mul", {
a * b
});
// finalize or anything
result
}