Fix MS compiler issue that I introduced into Freddie's code

Plus a little more code simplification.
This commit is contained in:
Andrew Johnson
2021-02-21 12:04:07 -06:00
parent 93208af61c
commit 9d0597fc15

View File

@@ -46,13 +46,11 @@ epicsUInt64 epicsMonotonicResolution(void)
epicsUInt64 epicsMonotonicGet(void)
{
LARGE_INTEGER val;
double dval;
if (!QueryPerformanceCounter(&val)) {
cantProceed("epicsMonotonicGet: Failed to read Windows Performance Counter\n");
return 0;
}
else { /* return value in nanoseconds */
val.QuadPart -= perfCounterOffset;
double nsec = (double)(val.QuadPart) * sec2nsec / perfCounterFrequency;
return (epicsUInt64)(nsec + 0.5);
}
dval = val.QuadPart - perfCounterOffset;
return (epicsUInt64)(dval * sec2nsec / perfCounterFrequency + 0.5);
}