Round sleep time to nearest tick. This is important when working with

high-precision time sources, such as event receivers.
This commit is contained in:
W. Eric Norum
2008-04-17 22:04:57 +00:00
parent b8f613881b
commit afd028c4ff

View File

@@ -255,7 +255,7 @@ void epicsThreadSleep(double seconds)
if(seconds<=0.0) {
ticks = 0;
} else {
ticks = seconds*sysClkRateGet();
ticks = seconds*sysClkRateGet() + 0.5;
if(ticks<=0) ticks = 1;
}
status = taskDelay(ticks);