mirror of
https://github.com/openharmony/third_party_rust_want.git
synced 2026-06-30 20:57:55 -04:00
add throughput benchmark
This commit is contained in:
@@ -0,0 +1,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());
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user