[Libav-user] Best way to create a fractional ms timer?
"René J.V. Bertin"
rjvbertin at gmail.com
Mon Apr 1 16:52:00 CEST 2013
On Apr 01, 2013, at 16:02, Nicolas George wrote:
> Le duodi 12 germinal, an CCXXI, "René J.V. Bertin" a écrit :
>> I may be mistaken, but I think that the higher your timer precision, the
>> lower the jitter such 'force-majeur' events produce (or, the jitter is
>> proportional to your timer's precision). Right?
> I believe you are wrong: you mix timer precision and time slice.
> On a NOHZ Linux x86_64 kernel and an idle system, the precision of nanosleep
> seems to be 100 µs, but if your system is busy, the process will be
> preempted for a full time slice, and that is much larger, above 500 µs.
In any case we seem to agree that it all depends on how the timer is implemented, and of course that goes both ways. Your nanosleep function that has a precision 100000x worse than what one might expect seems to be a good case in point.
(What's a NOHZ kernel?)
More information about the Libav-user