From a977a19d79c5e842c54ad274f8d75527e3f7dde0 Mon Sep 17 00:00:00 2001 From: rubenasplund <ruben.asplund@hotmail.com> Date: Fri, 4 Dec 2020 11:36:39 +0100 Subject: [PATCH] Exercise B --- examples/rtt_timing.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/rtt_timing.rs b/examples/rtt_timing.rs index 1dc033c..b0af834 100644 --- a/examples/rtt_timing.rs +++ b/examples/rtt_timing.rs @@ -78,19 +78,19 @@ fn timed_loop() -> (u32, u32) { // B.1) What is the cycle count for the loop? // > cargo run --example rtt_timing --release // -// [Your answer here] +// [903726927 - 903719926 = 7001] // // B.2) How many cycles per iteration? // -// [Your answer here] +// [7001/1000 = 7] // // What is the speedup (A/B)? // -// [Your answer here] +// [A/B = 4790/7 = 684 times] // // Why do you think it differs that much? // -// [Your answer here] +// [It removes some unnessesary code in the for loop which is inside the timed_loop().] // // ------------------------------------------------------------------------ // In the loop there is just a single assembly instruction (nop). -- GitLab