pause

Macro pause 

Source
macro_rules! pause {
    () => { ... };
}
Expand description

Pause all active profiling timers globally

When profiling is paused, all new timing measurements will be ignored. Existing timers will continue running but won’t record their results when dropped. This affects all profile!(), profile_async!(), and scoped_timer!() operations.

§Example

use quantum_pulse::{profile, pause, unpause, Operation};
use std::fmt::Debug;

#[derive(Debug)]
enum AppOperation {
    CriticalWork,
    NonCriticalWork,
}

impl Operation for AppOperation {}


// This will be recorded normally
profile!(AppOperation::CriticalWork, {
    perform_critical_work();
});

// Pause profiling
pause!();

// This won't be recorded
profile!(AppOperation::NonCriticalWork, {
    perform_non_critical_work();
});

// Resume profiling
unpause!();

// This will be recorded again
profile!(AppOperation::CriticalWork, {
    perform_more_critical_work();
});