3 releases

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

#176 in Profiling

Download history 221/week @ 2024-09-01 115/week @ 2024-09-08 53/week @ 2024-09-15 13/week @ 2024-09-22 49/week @ 2024-09-29 3/week @ 2024-10-06

98 downloads per month

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