Skip to main content

cu_measure

Macro cu_measure 

Source
macro_rules! cu_measure {
    ( $label:expr, $body:expr ) => { ... };
}
Expand description

Run a closure and log the CU consumed by it (feature-gated).

Returns the closure’s result. When cu-trace is not enabled, just runs the closure with zero overhead.

§Usage

let result = cu_measure!("deserialize", || {
    parse_instruction_data(data)
});