Fix benchmark test

This commit is contained in:
SoniEx2 2018-12-03 13:46:52 -02:00
parent 1074cc7ee3
commit ef8e20bb86
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "eventbus"
version = "0.5.1"
version = "0.5.2"
authors = ["SoniEx2 <endermoneymod@gmail.com>"]
description = "Safe, fast and concurrent event system, inspired by the MinecraftForge event bus."
keywords = ["event", "safe", "fast", "concurrent", "bus"]

View File

@ -18,7 +18,7 @@ fn my_hook(_event: &mut MyEvent) {
fn criterion_benchmark(c: &mut Criterion) {
let bus = EventBus::new();
register_hook!(&bus, 0, MyEvent, my_hook);
c.bench_function("one_hook", move |b| b.iter(|| post_event!(&bus, MyEvent, &mut MyEvent {})));
c.bench_function("one_hook", move |b| b.iter(|| post_event!(&bus, &mut MyEvent {}, MyEvent)));
}
criterion_group!(benches, criterion_benchmark);