projects/lcdd/branches/v04-00-00-pre/include/lcdd/util
--- projects/lcdd/branches/v04-00-00-pre/include/lcdd/util/TimeUtil.hh 2014-05-08 23:24:18 UTC (rev 3116)
+++ projects/lcdd/branches/v04-00-00-pre/include/lcdd/util/TimeUtil.hh 2014-05-08 23:29:28 UTC (rev 3117)
@@ -5,6 +5,7 @@
#include <string>
#include <map>
+#include <iostream>
class TimeUtil {
@@ -32,6 +33,8 @@
}
static void addTime(const std::string& name, long nanos) {
+ if (!haveTimer(name))
+ createTimer(name);
_timerMap[name] += nanos;
}
@@ -43,6 +46,10 @@
return _timerMap[name];
}
+ static void printOut(const std::string& name, std::ostream& os) {
+ os << name << ": " << _timerMap[name] << std::endl;
+ }
+
static void clearTimers() {
_timerMap.clear();
}