Macro with_timing

Source
macro_rules! with_timing {
    ($closure:expr) => { ... };
}
Expand description

Conditionally execute timing code only when logging feature is enabled.

This macro helps avoid the overhead of timing operations when logging is disabled.

§Example

use kryst::utils::profiling::with_timing;
 
with_timing!(|| {
    log::trace!("Starting expensive operation");
    let start = std::time::Instant::now();
    // ... operation ...
    log::trace!("Operation took {:?}", start.elapsed());
});