benchmark

Attribute Macro benchmark 

Source
#[benchmark]
Expand description

Marks a function as a benchmark.

This macro registers the function in the global benchmark registry and makes it available for execution via the bench-sdk runtime.

§Example

use mobench_sdk::benchmark;

#[benchmark]
fn fibonacci_bench() {
    let result = fibonacci(30);
    std::hint::black_box(result);
}

The macro preserves the original function and creates a registration entry that allows the benchmark to be discovered and invoked by name.