#![feature(test)] | |
extern crate test; | |
use test::Bencher; | |
extern crate rusticata_macros; | |
use rusticata_macros::bytes_to_u64; | |
#[bench] | |
fn bench_bytes_to_u64(b: &mut Bencher) { | |
let bytes = &[0x12, 0x34, 0x56, 0x78, 0x90, 0x12]; | |
b.iter(|| { | |
let res = bytes_to_u64(bytes); | |
assert_eq!(res, Ok(0x123456789012)); | |
}); | |
} |