1 #ifndef CondCommon_TimeConversions_h
2 #define CondCommon_TimeConversions_h
10 #include "boost/date_time/posix_time/posix_time.hpp"
16 typedef boost::date_time::subsecond_duration<boost::posix_time::time_duration, 1000000000>
nanoseconds;
28 return (
t << 32) + iValue.second;
32 inline unsigned int itsNanoseconds(boost::posix_time::time_duration
const& td) {
33 return boost::posix_time::time_duration::num_fractional_digits() == 6 ? 1000 * td.fractional_seconds()
34 : td.fractional_seconds();
37 const boost::posix_time::ptime
time0 = boost::posix_time::from_time_t(0);
44 boost::posix_time::time_duration td = bt -
time0;
53 stv.tv_sec = iValue >> 32;
54 stv.tv_usec = (
kLowMask & iValue) / 1000;
60 return (
t << 32) + 1000 * stv.tv_usec;
65 ::gettimeofday(&stv,
nullptr);