3 releases

0.1.2 Sep 10, 2024
0.1.1 Sep 4, 2024
0.1.0 Sep 4, 2024

#173 in Profiling

46 downloads per month
Used in ring-log

MIT license

4KB
94 lines

Timing

build & test license

Easily measure executable time of a code block in human readable form. A rdtsc variant is also available for x86_64 architectures.

let time = timing(|| {
    println!("A fn that takes a few micros");
});

let (val, time) = timing_return(|| {
    println!("A fn that takes a few micros");
    5
});

let counter = timing_rdtsc(|| {
    println!("...");
});

let (val, counter) = timing_rdtsc_return(|| {
    println!("...");
    42
});

No runtime deps