-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbench.rs
More file actions
27 lines (23 loc) · 698 Bytes
/
bench.rs
File metadata and controls
27 lines (23 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use took::{Timer, Took};
const RUNS: usize = 100;
fn main() {
println!("Benchmarking all days with {} runs...", RUNS);
let times: Vec<_> = runner::jobs()
.iter()
.map(|j| {
(
j.1,
(0..RUNS)
.map(|_| {
let took = Timer::new();
j.0();
took.took().into_std()
})
.min()
.unwrap(),
)
})
.collect();
times.iter().for_each(|t| Took::from_std(t.1).describe(t.0));
Took::from_std(times.into_iter().map(|(_, t)| t).sum()).describe("everything");
}