std: add benchmark for vec.mut_iter.
This commit is contained in:
parent
fbb7cd32c3
commit
1992765dd3
1 changed files with 13 additions and 0 deletions
|
@ -3595,4 +3595,17 @@ mod bench {
|
|||
if sum == 0 {fail!()}
|
||||
}
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn mut_iterator(bh: &mut BenchHarness) {
|
||||
let mut v = vec::from_elem(100, 0);
|
||||
|
||||
do bh.iter {
|
||||
let mut i = 0;
|
||||
foreach x in v.mut_iter() {
|
||||
*x = i;
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue