Expand description
§MacroTime
MacroTime
is very easy to use. To time the execution of a block of code:
use macrotime::*;
let time = time!({
// do some stuff...
});
println!("This operation took {} ms!", time.as_millis());
You can also have MacroTime
print the time taken to perform a task on its own. To do this:
use macrotime::*;
dbg_time!("context...", {
// do some stuff...
});
In this scenario, the time will printed in the most relevant unit, so no need for formatting.