8 int const power[] = {1000*1000, 100*1000, 10*1000, 1000, 100, 10, 1};
13 TimeOfDay::TimeOfDay() : tv_(
TimeOfDay::setTime_()) {
22 gettimeofday(&tv,
nullptr);
28 std::ios::fmtflags oldflags = os.flags();
30 localtime_r(&tod.
tv_.tv_sec, &timebuf);
31 typedef std::ostreambuf_iterator<char, std::char_traits<char> > Iter;
32 std::time_put<char, Iter>
const& tp = std::use_facet<std::time_put<char, Iter> >(std::locale());
36 char const pattern[] =
"%d-%b-%Y %H:%M:%S %Z";
37 tp.put(begin, os,
' ', &timebuf, pattern, pattern +
sizeof(pattern) - 1);
39 char const pattern[] =
"%d-%b-%Y %H:%M:%S.";
40 tp.put(begin, os,
' ', &timebuf, pattern, pattern +
sizeof(pattern) - 1);
42 os << std::setfill(
'0') << std::setw(precision) << tod.
tv_.tv_usec/power[
precision] <<
' ';
43 tp.put(begin, os,
' ', &timebuf,
'Z');
static struct timeval setTime_()
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.