26 o << key <<
"_" << version;
35 return _timers.find(tmp_key)->second;
47 o << key <<
"_" << version;
68 std::ostringstream what;
69 what <<
"unknown timer \"" << key <<
"\" requested.";
70 throw std::invalid_argument(what.str());
83 std::ostringstream what;
84 what <<
"unknown timer \"" << key <<
"\" requested.";
85 throw std::invalid_argument(what.str());
95 for (
const auto & _timer :
_timers)
98 sprintf(str,
"%-20s [%2i] - %-6g ms (%s)-.",
99 _timer.second.get()->get_name().c_str(),
100 _timer.second.get_uid(),
101 _timer.second.get()->elapsed(),
102 (
char*) ((_timer.second.get()->get_state() ==
PHTimer::RUN) ?
" (running)" :
" (stopped)"));
103 out << str << std::endl;
111 sprintf(str,
"single_shot - %-20s [%2i] - %-6g ms (%s)-.",
112 _single_shot_timer.second.get()->get_name().c_str(),
113 _single_shot_timer.second.get_uid(),
114 _single_shot_timer.second.get()->elapsed(),
115 (
char*) ((_single_shot_timer.second.get()->get_state() ==
PHTimer::RUN) ?
" (running)" :
" (stopped)"));
116 out << str << std::endl;
134 for (
const auto & _timer :
_timers)
135 if (_timer.second.get()->get_ncycle())
138 sprintf(str,
"%-20s [%2i] - Accumulated time: %-6g ms. cycles: %-10u. Time per cycle: %-6g ms",
139 _timer.second.get()->get_name().c_str(),
140 _timer.second.get_uid(),
141 _timer.second.get()->get_accumulated_time(),
142 _timer.second.get()->get_ncycle(),
143 _timer.second.get()->get_time_per_cycle());
144 out << str << std::endl;
148 PHTimer::PRINT(out,
"Mutoo PHTimeServer single_shots statistics");
150 if (_single_shot_timer.second.get()->get_ncycle())
153 sprintf(str,
"single_shot - %-20s [%2i] - accumulated: %-6g ms.",
154 _single_shot_timer.second.get()->get_name().c_str(),
155 _single_shot_timer.second.get_uid(),
156 _single_shot_timer.second.get()->get_accumulated_time());
160 if (_single_shot_timer.second.get()->get_ncycle() != 1)
161 out <<
" WARNING: single_shot started more than once.";