1 #![feature(test)] 2 3 extern crate test; 4 use test::Bencher; 5 6 extern crate rusticata_macros; 7 8 use rusticata_macros::combinator::be_var_u64; 9 10 #[bench] bench_bytes_to_u64(b: &mut Bencher)11fn bench_bytes_to_u64(b: &mut Bencher) { 12 let bytes = &[0x12, 0x34, 0x56, 0x78, 0x90, 0x12]; 13 b.iter(|| { 14 let res = be_var_u64::<()>(bytes).unwrap(); 15 assert_eq!(res.1, 0x123456789012); 16 }); 17 } 18