Crates.io | ibench |
lib.rs | ibench |
version | 0.1.1 |
source | src |
created_at | 2023-10-15 20:34:00.907369 |
updated_at | 2023-10-15 20:36:10.068305 |
description | Extremely simple and small Rust library for quickly timing a closure |
homepage | https://github.com/Antosser/instant-benchmark-rs |
repository | https://github.com/Antosser/instant-benchmark-rs |
max_upload_size | |
id | 1004102 |
size | 2,539 |
Extremely simple and small Rust library for quickly timing a closure
use ibench::{time, print_time};
fn function() {
for _ in 0..100_000_000 {}
}
time(function); // returns duration
print_time(function) // prints time in human-readable format
Copying and distribution of this file, with or without modification, are permitted in any medium provided you do not contact the author about the file or any problems you are having with the file.