[Libav-user] Best way to create a fractional ms timer?

Nicolas George nicolas.george at normalesup.org
Mon Apr 1 12:07:34 CEST 2013

Le duodi 12 germinal, an CCXXI, René J.V. Bertin a écrit :
> I presume MS Windows still doesn't provide timers with <1ms resolution, be
> it event-based or something like usleep/nanosleep? I haven't seen your
> original post, but I've already struggled myself to get reliable 1kHz
> realtime behaviour without external hardware. I ended up with a busy-wait
> loop, (hogging the CPU was acceptable in my case).

Basic sanity check: I hope everyone here realizes that on a non-real time
OS, even a timer with that kind of nominal precision can end up waiting a
few dozens milliseconds because the screen saver activated or a page was
needed from the swap? Modern hardware, with multicore CPUs and loads of
memory, make this less severe a problem, but you still get no guarantee at


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130401/fbc5ccaf/attachment.asc>

More information about the Libav-user mailing list