Skip to content

Instantly share code, notes, and snippets.

@benwilson512
Created November 27, 2014 04:17
Show Gist options
  • Save benwilson512/56f84ffffd4625f11feb to your computer and use it in GitHub Desktop.
Save benwilson512/56f84ffffd4625f11feb to your computer and use it in GitHub Desktop.
#[bench]
fn test_overflow(b: &mut Bencher) {
let nums = [0i, ..1000000];
b.iter(|| {
let mut x = 0i;
for i in range(0, nums.len()) {
x = nums[i];
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment