From 0540fa9e26e2c8e7e11fcf3e5444e4981f811e1c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 31 May 2023 16:14:31 +0200 Subject: port TRNS to dfatool --- TRNS/baselines/cpu/support/timer.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'TRNS/baselines/cpu/support') diff --git a/TRNS/baselines/cpu/support/timer.h b/TRNS/baselines/cpu/support/timer.h index 70ee386..d8ef221 100644 --- a/TRNS/baselines/cpu/support/timer.h +++ b/TRNS/baselines/cpu/support/timer.h @@ -47,9 +47,7 @@ struct Timer { map time; void start(string name) { - if(!time.count(name)) { - time[name] = 0.0; - } + time[name] = 0.0; gettimeofday(&startTime[name], NULL); } @@ -59,5 +57,6 @@ struct Timer { (stopTime[name].tv_usec - startTime[name].tv_usec); } - void print(string name, int REP) { printf("%s Time (ms): %f\n", name.c_str(), time[name] / (1000 * REP)); } + void print(string name, int REP) { printf("%s Time (ms): %f\n", name.c_str(), time[name] / (1000 * REP)); } + double get(string name) { return time[name]; } }; -- cgit v1.2.3