easybench-rs
easybench-rs copied to clipboard
benchmark for slow functions?
It would be convenient to have a function that just ran its argument once and timed it. For things that take seconds or minutes.
This is pretty quick 'n' easy to do with the standard library:
let ts = std::time::Instant::now();
my_function();
println!("{:?}", ts.elapsed());
Were you imagining something more complicated than that?
I was imagining something about that simple, but using the same framework as easybench. But now I'm wondering whether it would be better to make easybench automatically work for slow benchmarks. It's not like we can't tell when a benchmark takes a full minute.