macro_rules! debug_stopwatch {
($threshold:expr, $($arg:tt)+) => { ... };
}Expand description
Creates a Stopwatch that will log a debug message if the elapsed time exceeds the threshold.
use local_async_utils::prelude::*;
let sw = debug_stopwatch!(sec!(0), "10 milliseconds of sleep");
std::thread::sleep(millisec!(10));
drop(sw); // Logs: "10 milliseconds of sleep finished in 10ms"