Crates.io | timing_rdtsc |
lib.rs | timing_rdtsc |
version | 0.1.2 |
source | src |
created_at | 2024-09-04 13:51:15.023337 |
updated_at | 2024-09-10 19:27:18.850375 |
description | Easily time a block of code |
homepage | |
repository | https://github.com/freergit/timing.git |
max_upload_size | |
id | 1363358 |
size | 6,848 |
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
});