diff --git a/examples/timing_exam.rs b/examples/timing_exam.rs index 0d99c671f5d6f0e1400a58bfcb3d9ad25aec3b12..e582440f7860927e20fbfe5804695f0da4c1e258 100644 --- a/examples/timing_exam.rs +++ b/examples/timing_exam.rs @@ -40,7 +40,7 @@ const APP: () = { #[inline(never)] #[task(schedule = [t1], priority = 1)] fn t1(cx: t1::Context) { - let start = Instant::now(); + //let start = Instant::now(); asm::bkpt(); cx.schedule.t1(cx.scheduled + 100_000.cycles()).unwrap(); asm::bkpt(); @@ -50,7 +50,7 @@ const APP: () = { // 2) your code here to update T1_MAX_RP and // break if deadline missed - let resp: u32= start.elapsed().as_cycles(); + let resp: u32= cx.scheduled.elapsed().as_cycles(); if resp > 100_000 { //panic!(); asm::bkpt(); @@ -67,7 +67,7 @@ const APP: () = { #[inline(never)] #[task(schedule = [t2], resources = [R1, R2], priority = 2)] fn t2(mut cx: t2::Context) { - let start = Instant::now(); + //let start = Instant::now(); asm::bkpt(); cx.schedule.t2(cx.scheduled + 200_000.cycles()).unwrap(); @@ -95,7 +95,7 @@ const APP: () = { // 2) your code here to update T2_MAX_RP and // break if deadline missed - let resp: u32= start.elapsed().as_cycles(); + let resp: u32= cx.scheduled.elapsed().as_cycles(); if resp > 200_000 { //panic!(); asm::bkpt(); @@ -112,7 +112,7 @@ const APP: () = { #[inline(never)] #[task(schedule = [t3], resources = [R2], priority = 3)] fn t3(cx: t3::Context) { - let start = Instant::now(); + //let start = Instant::now(); asm::bkpt(); cx.schedule.t3(cx.scheduled + 50_000.cycles()).unwrap(); asm::bkpt(); @@ -129,7 +129,7 @@ const APP: () = { // 2) your code here to update T3_MAX_RP and // break if deadline missed - let resp: u32= start.elapsed().as_cycles(); + let resp: u32= cx.scheduled.elapsed().as_cycles(); if resp > 50_000 { //panic!(); asm::bkpt();