blob: 233ea0506c00a362aba2ce2ed1fbbb039ff5889a (
plain)
1
2
3
4
5
6
7
8
9
|
use test::Bencher;
#[bench]
fn bench_pow_function(b: &mut Bencher) {
let v = (0..1024).collect::<Vec<u32>>();
b.iter(|| {
v.iter().fold(0u32, |old, new| old.pow(*new as u32));
});
}
|