You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
430 B

//! Benchmarks :^)
#![allow(unused_imports)]
use super::*;
extern crate test;
use test::{Bencher, black_box};
#[bench]
fn mask(b: &mut Bencher)
{
b.iter(|| {
for i in 0..0o777u32 {
let bits = Permissions::from(i);
black_box(bits);
}
});
}
#[bench]
fn from_mask(b: &mut Bencher)
{
b.iter(|| {
for i in 0..0o777u32 {
let bits = Permissions::from(i);
black_box(u32::from(bits));
}
});
}