diff --git a/examples/rtic_bare3.rs b/examples/rtic_bare3.rs index 9173175c051d4b3e4615e0db20d2b08265d59763..84ab978fd011adc0fed2e37c5fc311d99b05ce3a 100644 --- a/examples/rtic_bare3.rs +++ b/examples/rtic_bare3.rs @@ -10,6 +10,8 @@ #![no_main] #![no_std] +use core::time::Duration; + use cortex_m_semihosting::hprintln; use panic_semihosting as _; use rtic::cyccnt::Instant; @@ -28,7 +30,8 @@ const APP: () = { // notice all printing outside of the section to measure! hprintln!("Start {:?}", start).ok(); hprintln!("End {:?}", end).ok(); - // hprintln!("Diff {:?}", (end - start) ).ok(); + let diff = Instant::duration_since(&end,start); + hprintln!("Diff {:?}", diff.as_cycles()).ok(); } }; @@ -76,7 +79,8 @@ fn wait(i: u32) { // // What is now the output in the Adapter Output console? // -// ** your answer here ** +// Start Instant(2694714472) +// End Instant(2698714489) // // Commit your answers (bare3_1) // @@ -86,7 +90,9 @@ fn wait(i: u32) { // // What is now the output in the Adapter Output console? // -// ** your answer here ** +// Start Instant(20606036) +// End Instant(24606052) +// Diff 4000016 // // Commit your answers (bare3_2) //