3 releases

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

#189 in Profiling

Download history 205/week @ 2024-08-31 127/week @ 2024-09-07 55/week @ 2024-09-14 15/week @ 2024-09-21 48/week @ 2024-09-28 4/week @ 2024-10-05

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