32 #ifndef PLANCK_WALLTIMER_H 33 #define PLANCK_WALLTIMER_H 42 double t_acc, t_started;
46 wallTimer() : t_acc(0.), t_started(0.), running(false) {}
47 void start(
double wtime_now)
48 {
if (!running) { t_started=wtime_now; running=
true; } }
50 void stop(
double wtime_now)
51 {
if (running) { t_acc+=wtime_now-t_started; running=
false; } }
53 void reset() { t_acc=t_started=0.; running=
false;}
54 double acc(
double wtime_now)
const 55 {
return running ? t_acc+wtime_now-t_started : t_acc; }
62 typedef std::map<std::string,int> maptype;
66 std::vector<wallTimer> timer;
69 int getIndex(
const std::string &name);
70 void start(
int index);
72 void stopstart(
int index1,
int index2);
73 void reset(
int index);
74 double acc(
int index);
75 void start(
const std::string &name);
76 void stop(
const std::string &name);
77 void stopstart(
const std::string &name1,
const std::string &name2);
78 void reset(
const std::string &name);
79 double acc(
const std::string &name);
83 const maptype &table()
const {
return lut; }
86 extern wallTimerSet wallTimers;
88 void tstack_push(
const std::string &name);
89 void tstack_pop(
const std::string &name);
91 void tstack_replace(
const std::string &name1,
const std::string &name2);
92 void tstack_replace(
const std::string &name);
93 void tstack_report(
const std::string &stem);