with_monitoring

Macro with_monitoring 

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

Conditionally execute monitoring code only when monitoring is enabled.

This macro helps avoid the overhead of monitoring operations when monitoring is disabled at runtime.

§Example

use kryst::utils::profiling::with_monitoring;

with_monitoring!(|| {
    eprintln!("Iteration {}: residual = {:.2e}", iter, residual);
});