From ecf5e6e3345ce620513950fa0ad14aac1d8fd079 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sat, 24 Sep 2022 14:24:59 +0200 Subject: [PATCH] Improve test runtime --- ci/expected/periodic-at.run | 6 +++--- ci/expected/periodic-at2.run | 10 +++++----- examples/periodic-at.rs | 4 ++-- examples/periodic-at2.rs | 6 +++--- examples/periodic.rs | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ci/expected/periodic-at.run b/ci/expected/periodic-at.run index 54020f9e95..bf5bb0631b 100644 --- a/ci/expected/periodic-at.run +++ b/ci/expected/periodic-at.run @@ -1,4 +1,4 @@ foo Instant { ticks: 0 } -foo Instant { ticks: 100 } -foo Instant { ticks: 200 } -foo Instant { ticks: 300 } +foo Instant { ticks: 10 } +foo Instant { ticks: 20 } +foo Instant { ticks: 30 } diff --git a/ci/expected/periodic-at2.run b/ci/expected/periodic-at2.run index 47adbef486..6e56421a30 100644 --- a/ci/expected/periodic-at2.run +++ b/ci/expected/periodic-at2.run @@ -1,7 +1,7 @@ foo Instant { ticks: 0 } bar Instant { ticks: 10 } -foo Instant { ticks: 110 } -bar Instant { ticks: 120 } -foo Instant { ticks: 220 } -bar Instant { ticks: 230 } -foo Instant { ticks: 330 } +foo Instant { ticks: 30 } +bar Instant { ticks: 40 } +foo Instant { ticks: 60 } +bar Instant { ticks: 70 } +foo Instant { ticks: 90 } diff --git a/examples/periodic-at.rs b/examples/periodic-at.rs index f9fd995fb0..ca68ed5eb9 100644 --- a/examples/periodic-at.rs +++ b/examples/periodic-at.rs @@ -42,8 +42,8 @@ mod app { debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } - // Periodic ever 1 seconds - let next_instant = instant + 1.secs(); + // Periodic every 100 milliseconds + let next_instant = instant + 100.millis(); foo::spawn_at(next_instant, next_instant).unwrap(); } } diff --git a/examples/periodic-at2.rs b/examples/periodic-at2.rs index 879f709c65..ec9adcc50c 100644 --- a/examples/periodic-at2.rs +++ b/examples/periodic-at2.rs @@ -28,7 +28,7 @@ mod app { // Initialize the monotonic (SysTick rate in QEMU is 12 MHz) let mut mono = Systick::new(systick, 12_000_000); - foo::spawn_after(1.secs(), mono.now()).unwrap(); + foo::spawn_after(200.millis(), mono.now()).unwrap(); (Shared {}, Local {}, init::Monotonics(mono)) } @@ -54,8 +54,8 @@ mod app { fn bar(_cx: bar::Context, instant: ::Instant) { hprintln!("bar {:?}", instant).ok(); - // Spawn a new message with 1s offset to spawned time - let next_instant = instant + 1.secs(); + // Spawn a new message with 200ms offset to spawned time + let next_instant = instant + 200.millis(); foo::spawn_at(next_instant, next_instant).unwrap(); } } diff --git a/examples/periodic.rs b/examples/periodic.rs index 40c69257e7..2f9e8e6a64 100644 --- a/examples/periodic.rs +++ b/examples/periodic.rs @@ -28,7 +28,7 @@ mod app { // Initialize the monotonic (SysTick rate in QEMU is 12 MHz) let mono = Systick::new(systick, 12_000_000); - foo::spawn_after(1.secs()).unwrap(); + foo::spawn_after(100.millis()).unwrap(); (Shared {}, Local {}, init::Monotonics(mono)) } @@ -42,7 +42,7 @@ mod app { debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } - // Periodic ever 1 seconds - foo::spawn_after(1.secs()).unwrap(); + // Periodic every 100ms + foo::spawn_after(100.millis()).unwrap(); } }