diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2023-05-31 16:14:31 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2023-05-31 16:14:31 +0200 |
commit | 0540fa9e26e2c8e7e11fcf3e5444e4981f811e1c (patch) | |
tree | a450f403c535ded297b8ffc4a0ea5675e780a3de /TRNS/baselines/cpu/support/timer.h | |
parent | 0f710b4f47dfc51e3f01473995dbb6ed5844eff1 (diff) |
port TRNS to dfatool
Diffstat (limited to 'TRNS/baselines/cpu/support/timer.h')
-rw-r--r-- | TRNS/baselines/cpu/support/timer.h | 7 |
1 files changed, 3 insertions, 4 deletions
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<string, double> 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]; }
};
|