macro_rules! scoped_timer {
($operation:expr) => { ... };
}
Expand description
Create a scoped timer that records on drop
This is a convenience macro for creating a timer that automatically records when it goes out of scope.
ยงExample
use quantum_pulse::{scoped_timer, Category, Operation};
use std::fmt::Debug;
// Define your own operation type
#[derive(Debug)]
enum AppOperation {
ScopedOperation,
}
impl Operation for AppOperation {}
let op = AppOperation::ScopedOperation;
scoped_timer!(op);
// code to time