Bart Lateur wrote:
> One of your problems is that sleep(3) is NOT garanteed to sleep exactly
> 3 full seconds. It's only garanteed that the difference between time()
> before, and after, will be (at least) 3. So sleep 3 actually just has to
> wait for 3 time second rollovers. That may take for example only 2.5
> seconds.
> 
> Well, that's how it *used* to be. Maybe perl's behaviour has been
> changed since then.
> 
> If you expect sleep(2.5) to work properly, then sleep(3) should be
> fixed, too.

Actually, with event loops and threading issues, probably things like
the perl built-ins sleep and alarm won't ever be passed to the syscalls
sleep(3) and alarm(3). Perl will probably block that instance of the
interpreter internally and do some other stuff. It will probably use
its internal clock to measure the time to unblock it, and that clock
will probably have sub-second precision.

- Branden

Reply via email to