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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user