42 double t = (double)m_time.tv_sec + ((
double)m_time.tv_usec / 1000000.0);
53 time_t seconds = m_time.tv_sec;
54 struct tm* seconds_tm = localtime(&seconds);
55 char* text = asctime(seconds_tm);
60 us = us.substr(us.length() - 6, 6);
61 s +=
" " + us +
" us";
71 m_time.tv_sec = (
UINT32)time;
72 m_time.tv_usec = (time - (double)((
UINT32)time)) * 1000000;
86 set(
static_cast<UINT64>(ntpTime >> 32), static_cast<UINT32>(ntpTime));
95 m_time.tv_sec = ntpSeconds - secondsFrom1900to1970;
96 m_time.tv_usec = ntpFractionalSeconds * m_secondFractionNTPtoNanoseconds / 1000;
104 double s = (double)m_time.tv_sec + ((
double)m_time.tv_usec / 1000000);
113 UINT32 ms = (m_time.tv_sec * 1000) + (m_time.tv_usec / 1000);
124 m_time.tv_usec += other.
m_time.tv_usec;
125 if (m_time.tv_usec > 1000000)
128 m_time.tv_usec -= 1000000;
130 m_time.tv_sec += other.
m_time.tv_sec;
141 t.
m_time.tv_usec = (m_time.tv_usec + other.
m_time.tv_usec);
142 if (t.
m_time.tv_usec > 1000000)
145 t.
m_time.tv_usec -= 1000000;
171 gettimeofday(&(t.
m_time), NULL);
181 if (m_time.tv_sec > other.
m_time.tv_sec)
185 else if ((m_time.tv_sec == other.
m_time.tv_sec) &&
186 (m_time.tv_usec >= other.
m_time.tv_usec))
199 if (m_time.tv_sec < other.
m_time.tv_sec)
204 else if ((m_time.tv_sec == other.
m_time.tv_sec) &&
205 (m_time.tv_usec < other.
m_time.tv_usec))
219 if ((m_time.tv_sec == other.
m_time.tv_sec) &&
220 (m_time.tv_usec == other.
m_time.tv_usec))
233 if (m_time.tv_sec > other.
m_time.tv_sec)
237 if (m_time.tv_usec < other.
m_time.tv_usec)
242 t.
m_time.tv_usec = (m_time.tv_usec + offset) - other.
m_time.tv_usec;
244 else if (m_time.tv_sec == other.
m_time.tv_sec)
247 if (m_time.tv_usec < other.
m_time.tv_usec)
253 t.
m_time.tv_usec = m_time.tv_usec - other.
m_time.tv_usec;
static const UINT64 secondsFrom1900to1970
Time & operator+=(const Time &other)
Time operator-(const Time &other) const
bool operator==(const Time &other) const
static const double m_nanosecondsToSecondFractionNTP
Time operator+(const TimeDuration &dur) const
bool operator<(const Time &other) const
static const double m_secondFractionNTPtoNanoseconds
std::string toLongString() const
UINT32 total_milliseconds()
static sick_scan::SickScanCommonTcp * s
bool operator>=(const Time &other) const
std::string toString() const