240 if ( this->perfCtrPresent ) {
241 EnterCriticalSection ( & this->mutex );
243 LARGE_INTEGER curPerfCounter;
244 QueryPerformanceCounter ( & curPerfCounter );
247 if ( curPerfCounter.QuadPart >= this->lastPerfCounter ) {
248 offset = curPerfCounter.QuadPart - this->lastPerfCounter;
263 if ( offset <
MAXLONGLONG / EPICS_TIME_TICKS_PER_SEC ) {
264 offset *= EPICS_TIME_TICKS_PER_SEC;
265 offset /= this->perfCounterFreq;
268 double fpOffset = static_cast <
double > ( offset );
269 fpOffset *= EPICS_TIME_TICKS_PER_SEC;
270 fpOffset /= static_cast <
double > ( this->perfCounterFreq );
271 offset = static_cast < LONGLONG > ( fpOffset );
273 LONGLONG epicsTimeCurrent = this->epicsTimeLast + offset;
274 if ( this->epicsTimeLast > epicsTimeCurrent ) {
275 double diff = static_cast <
double >
276 ( this->epicsTimeLast - epicsTimeCurrent ) / EPICS_TIME_TICKS_PER_SEC;
278 "currentTime::getCurrentTime(): %f sec " 279 "time discontinuity detected\n",
282 this->epicsTimeLast = epicsTimeCurrent;
283 this->lastPerfCounter = curPerfCounter.QuadPart;
285 LeaveCriticalSection ( & this->mutex );
288 ( epicsTimeCurrent / EPICS_TIME_TICKS_PER_SEC );
290 ( epicsTimeCurrent % EPICS_TIME_TICKS_PER_SEC );
296 GetSystemTimeAsFileTime ( & ft );
297 dest = epicsTime ( ft );
epicsUInt32 secPastEpoch
seconds since 0000 Jan 1, 1990
int errlogPrintf(const char *pFormat,...)
epicsUInt32 nsec
nanoseconds within second