1 2 3 4 5 6 7 8 9
#[macro_export] macro_rules! measure { ($label: literal, $block: block) => {{ let now = std::time::Instant::now(); let result = $block; println!("{}: {:.2?}", $label, now.elapsed()); result }}; }