Skip to content

Commit

Permalink
benches: Add fisrt test benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulTrombin committed Oct 16, 2023
1 parent 28d3062 commit 314de84
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions benches/bench.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#![feature(test)]

extern crate test;


use test::Bencher;


use navigator_rs::Navigator;
// use std::thread::sleep;
// use std::time::Duration;

// fn main() {
// println!("Creating your navigator module!");
// let mut nav = Navigator::new();

// println!("Setting up your navigator, ahoy!");
// nav.init();

// loop {
// nav.set_pwm_channel_value(PwmChannel::All, 0);
// println!("{:#?}", nav.fmt_debug());
// sleep(Duration::from_millis(1000));
// }
// }


#[bench]
fn init(b: &mut Bencher) {
b.iter(|| {
let mut nav = Navigator::new();
let _ = nav.init();
});
}

// #[bench]
// fn bench_fib_20(b: &mut Bencher) {
// b.iter(|| {
// let _ = fib(20);
// });
// }

0 comments on commit 314de84

Please sign in to comment.