Skip to content
Snippets Groups Projects
Commit 11863fb6 authored by Edvin Åkerfeldt's avatar Edvin Åkerfeldt
Browse files

rtt_timings, C done

parent 1b6e208d
No related branches found
No related tags found
No related merge requests found
......@@ -156,14 +156,33 @@ I.e there is no optimizations, no removal of uneccesary code no nothing.
// > cargo run --example rtt_timing --release --features nightly
//
// [Your answer here]
/*
40001 cycles
*/
//
// C.2) How many cycles per iteration?
//
// [Your answer here]
/*
Only running timng for the content of the for loop:
let mut start: u32 = 0;
let mut end: u32 = 0;
for _ in 0..10000 {
start = DWT::get_cycle_count();
asm::nop();
end = DWT::get_cycle_count()
}
You get 3 cycles.
But the total number of cycles divided by the loop iterations is 4,0001 ~= 4 cycles.
*/
//
// What is the speedup (A/C)?
//
// [Your answer here]
/*
A/C = 4790151/40001 = 119,7507812 ~= 120
*/
//
// ------------------------------------------------------------------------
// D) Now lets have a closer look at the generated assembly.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment