Comment 24 for bug 1861612

Revision history for this message
Ben Franksen (bfrk) wrote : Re: [Bug 1861612] Re: callbackRequestDelay not waiting for 1/60 sec on vxWorks

> So the minimal change to ensure epicsEventWaitWithTimeout() behaves as
> specified (timeout after >=delay) involves a float to int conversion
> like:
>
>> double delay = ...;
>> unsigned ticks = tickRate * delay;
>> ticks += 2;

I'd say it should be

unsigned ticks = ceil(tickRate * delay) + 1

In this way, a delay of 0.0 seconds results in a delay of 0.0 <= delay
<= tickRate, which is probably the desired outcome in this case.