• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![feature(test)]
2 
3 extern crate test;
4 
5 use smol::future;
6 use test::Bencher;
7 
8 #[bench]
task_create(b: &mut Bencher)9 fn task_create(b: &mut Bencher) {
10     b.iter(|| {
11         let _ = async_task::spawn(async {}, drop);
12     });
13 }
14 
15 #[bench]
task_run(b: &mut Bencher)16 fn task_run(b: &mut Bencher) {
17     b.iter(|| {
18         let (runnable, task) = async_task::spawn(async {}, drop);
19         runnable.run();
20         future::block_on(task);
21     });
22 }
23