Skip to content

Commit

Permalink
Add benchmark tests for play_game function
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuSoysal authored Feb 16, 2024
1 parent 25c2de1 commit f418c81
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,13 @@ mod benchmarks {
});
}

#[bench]
fn bench_play_game_100(b: &mut Bencher) {
b.iter(|| std::hint::black_box(play_game(100)));
}

#[bench]
fn bench_play_game_1_000_000(b: &mut Bencher) {
b.iter(|| std::hint::black_box(play_game(1_000_000)));
}
}

0 comments on commit f418c81

Please sign in to comment.