macro_rules! profile_start {
($name:ident) => { ... };
}Expand description
The profile_start! macro initializes a TimeLapse instance to start profiling.
It takes an identifier as an argument, which will be instantiated and used to reference the profiler instance.
ยงUsage
use std::time::Duration;
use timelapse::{TimeLapse, profile_start, profile_end};
profile_start!(my_profiler);
std::thread::sleep(Duration::from_millis(100));
assert!(my_profiler.elapsed().as_millis() >= 100);
profile_end!(my_profiler);