Skip to content
Snippets Groups Projects
Commit 6c41109f authored by Gustav Hansson's avatar Gustav Hansson
Browse files

bare 2

parent b06929c0
Branches
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ use panic_halt as _; ...@@ -18,7 +18,7 @@ use panic_halt as _;
use cortex_m::{iprintln, peripheral::DWT, Peripherals}; use cortex_m::{iprintln, peripheral::DWT, Peripherals};
use cortex_m_rt::entry; use cortex_m_rt::entry;
// burns CPU cycles by just looping `i` times // burns CPU cycles by just 5looping `i` times
#[inline(never)] #[inline(never)]
fn wait(i: u32) { fn wait(i: u32) {
for _ in 0..i { for _ in 0..i {
...@@ -77,18 +77,24 @@ fn main() -> ! { ...@@ -77,18 +77,24 @@ fn main() -> ! {
// //
// What is the output in the ITM console? // What is the output in the ITM console?
// //
// ** your answer here ** // bare2
// // Start 2012359631
// End 2139359709
// Diff 127000078
//
// Rebuild and run in release mode // Rebuild and run in release mode
// //
// > cargo build --example bare2 --release // > cargo build --example bare2 --release
// //
// ** your answer here ** // bare2
// Start 3019839635
// End 3026839650
// Diff 7000015
// //
// Compute the ratio between debug/release optimized code // Compute the ratio between debug/release optimized code
// (the speedup). // (the speedup).
// //
// ** your answer here ** // 18,1428 times faster
// //
// commit your answers (bare2_1) // commit your answers (bare2_1)
// //
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment