1 2 3 4 5 6 7 8 9 10 11 12 13 14
#![feature(test)] extern crate test; extern crate want; #[bench] fn throughput(b: &mut test::Bencher) { let (mut gv, mut tk) = want::new(); b.iter(move || { tk.want(); assert!(gv.poll_want().unwrap().is_ready()); }); }