summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perform/pio_timer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/perform/pio_timer.c b/perform/pio_timer.c
index 247b3c3..0bfb96a 100644
--- a/perform/pio_timer.c
+++ b/perform/pio_timer.c
@@ -111,8 +111,11 @@ set_time(pio_time *pt, timer_type t, int start_stop)
struct timeval sys_t;
gettimeofday(&sys_t, NULL);
- pt->total_time[t] += (double)pt->sys_timer[t].tv_sec +
- ((double)pt->sys_timer[t].tv_usec) / MILLISECOND;
+ pt->total_time[t] =
+ ((double)sys_t.tv_sec +
+ ((double)sys_t.tv_usec) / MILLISECOND) -
+ ((double)pt->sys_timer[t].tv_sec +
+ ((double)pt->sys_timer[t].tv_usec) / MILLISECOND);
}
}
}