41 double TimeStamp::TimespecToDouble(const ::timespec& LargeInt)
43 return double(LargeInt.tv_sec) + double(LargeInt.tv_nsec) / 1e9;
46 ::timespec TimeStamp::DoubleToTimespec(
double TimeS)
49 if (!(TimeS < 4e9 && TimeS > 0.0))
52 DeltaTime.tv_nsec = 0;
56 DeltaTime.tv_sec = ::time_t(TimeS);
57 DeltaTime.tv_nsec =
static_cast<long int>((TimeS - double(DeltaTime.tv_sec)) * 1e9);
66 Res.tv_sec =
m_TimeStamp.tv_sec - EarlierTime.m_TimeStamp.tv_sec;
67 Res.tv_nsec =
m_TimeStamp.tv_nsec - EarlierTime.m_TimeStamp.tv_nsec;
72 Res.tv_nsec += 1000000000;
75 return TimespecToDouble(Res);
80 ::timespec Dbl = DoubleToTimespec(TimeS);
92 ::timespec Dbl = DoubleToTimespec(TimeS);
155 return LargeInt.HighPart *
m_DwordSize + LargeInt.LowPart;
160 LARGE_INTEGER DeltaTime;
161 DeltaTime.LowPart = 0;
162 DeltaTime.HighPart = 0;
163 if (!(TimeS < 4e9 && TimeS > 0.0))
184 if ((Res.LowPart <
m_TimeStamp.LowPart) || (Res.LowPart < Dbl.LowPart))
194 Res.HighPart =
m_TimeStamp.HighPart - Dbl.HighPart;