Commit 741a26865c0ebadb7d27b1d33ced2dd55a4cc07f

Authored by Aravind Kumar
1 parent 91a330bc1a
Exists in master

CPU Measurement # 2 loop overhead

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

cpu/loop_overhead_time.c View file @ 741a268
... ... @@ -11,9 +11,9 @@
11 11 asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (time1));
12 12 for (i = 0; i < 1000; i++);
13 13 asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r" (time2));
14   - sum++;
15   - avg += (time2 - time1 - 5);
  14 + avg = (time2 - time1 - 5);
16 15 printf("Loop overhead: %u\n", avg/(1000));
  16 + sum++;
17 17 }
18 18 }