Function superluminal_perf::begin_event
source · pub fn begin_event(id: &'static str)
Expand description
Begin an instrumentation event with the specified ID
Examples found in repository?
examples/basic.rs (line 22)
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
fn big_fn() {
// work 1
superluminal_perf::begin_event("example-work1");
let v = heavy_calc1();
superluminal_perf::end_event();
println!("work1 done: {}", v);
// work 2
superluminal_perf::begin_event("example-work2");
let v = heavy_calc2();
superluminal_perf::end_event();
println!("work2 done: {}", v);
}