1 2 3 4 5 6 7 8 9 10 11
#[macro_export] macro_rules! clock { ($x: stmt) => { let start = std::time::Instant::now(); $x let elapsed_sec = std::time::Instant::now() .duration_since(start) .as_secs_f32(); println!("Total: {:.10}", elapsed_sec); }; }