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