Compare commits
2 Commits
dce5c466bd
...
0dd9528733
Author | SHA1 | Date |
---|---|---|
John Nunley | 0dd9528733 | |
John Nunley | df411fa7b7 |
|
@ -6,13 +6,9 @@ const COUNT: usize = 8000;
|
|||
fn bench_events(c: &mut Criterion) {
|
||||
c.bench_function("notify_and_wait", |b| {
|
||||
let ev = Event::new();
|
||||
let mut handles = Vec::with_capacity(COUNT);
|
||||
b.iter(|| {
|
||||
let mut handles = Vec::with_capacity(COUNT);
|
||||
|
||||
for _ in 0..COUNT {
|
||||
handles.push(ev.listen());
|
||||
}
|
||||
|
||||
handles.extend(iter::repeat_with(|| ev.listen()).take(COUNT));
|
||||
ev.notify(COUNT);
|
||||
|
||||
for handle in handles {
|
||||
|
|
Loading…
Reference in New Issue