On my box at home (A), usleep will sleep (approximately) the number of microseconds you pass to it. (requested + 0-2000us)
On another box (B), it is all over the place. Some times +10000, sometimes +20000!
I can deal with a 2000us wiggle, but a I can't handle the usleep instability on machine B.
And, I am having a hell of a time trying to figure out its source.
Originally I had Time:HiRes version 1.66 at home on box A and box B had 1.38 (from the RH RPM). I thought that was the problem so I installed 1.66 from CPAN onto box B. But 1.38 and 1.66 have the same behavior on machine B ...
machine A: 1CPU Athlon with Fedora Core 3
machine B: looks like a 2CPU with HyperThreading on running RedHat Enterprise Linux WS
machine C, 2CPU with HyperThreading off running RH EL AS, has the same results as B.
Something related to RedHat Enterprise Linux? I doubt that it would be due to multi CPUs.