Macro logging_timer::stimer
source · macro_rules! stimer { ($name:expr) => { ... }; ($level:expr; $name:expr) => { ... }; ($level:expr; $name:expr, $format:tt) => { ... }; ($name:expr, $format:tt) => { ... }; ($name:expr, $format:tt, $($arg:expr),*) => { ... }; ($level:expr; $name:expr, $format:tt, $($arg:expr),*) => { ... }; }
Expand description
Creates a timer that logs a starting mesage and a finished message.
§Examples
Note that when specifying the log level you must use a semi-colon as a separator, this is to ensure disambiguous parsing of the macro arguments.
use logging_timer::{stime, time, stimer, timer, Level};
let _tmr1 = stimer!("FIND_FILES");
let _tmr2 = stimer!(Level::Info; "FIND_FILES");
let _tmr3 = stimer!("FIND_FILES", "Found {} files", 42);
let _tmr4 = stimer!(Level::Trace; "FIND_FILES", "Found {} files", 42);