feat: delays in bench.rs
This commit is contained in:
parent
1c4ffa19a6
commit
009ed1fb50
1 changed files with 4 additions and 2 deletions
|
@ -18,7 +18,7 @@ macro_rules! display_results {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn bench(pin: &mut Pin<Output<PushPull>>, delay: &mut Delay) {
|
pub fn bench(pin: &mut Pin<Output<PushPull>>, delay: &mut Delay) {
|
||||||
bench_delay(pin, delay);
|
bench_delay(pin, delay);
|
||||||
bench_crc(pin);
|
bench_crc(pin, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bench_delay(pin: &mut Pin<Output<PushPull>>, delay: &mut Delay) {
|
fn bench_delay(pin: &mut Pin<Output<PushPull>>, delay: &mut Delay) {
|
||||||
|
@ -47,11 +47,13 @@ where
|
||||||
total / RUNS
|
total / RUNS
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bench_crc(pin: &mut Pin<Output<PushPull>>) {
|
fn bench_crc(pin: &mut Pin<Output<PushPull>>, delay: &mut Delay) {
|
||||||
const DATA: &[u8] = b"hello world AAAAAAAAAAAAAAAAAAAAAAA";
|
const DATA: &[u8] = b"hello world AAAAAAAAAAAAAAAAAAAAAAA";
|
||||||
|
delay.delay_ms(50_u32);
|
||||||
let native = time_exec(pin, || {
|
let native = time_exec(pin, || {
|
||||||
Crc32Rust::checksum(DATA);
|
Crc32Rust::checksum(DATA);
|
||||||
});
|
});
|
||||||
|
delay.delay_ms(50_u32);
|
||||||
let c_code = time_exec(pin, || {
|
let c_code = time_exec(pin, || {
|
||||||
Crc32C::checksum(DATA);
|
Crc32C::checksum(DATA);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue