easybench-rs icon indicating copy to clipboard operation
easybench-rs copied to clipboard

benchmark for slow functions?

Open droundy opened this issue 4 years ago • 2 comments

It would be convenient to have a function that just ran its argument once and timed it. For things that take seconds or minutes.

droundy avatar Feb 17 '21 17:02 droundy

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?

asayers avatar Feb 28 '21 12:02 asayers

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.

droundy avatar Feb 28 '21 20:02 droundy