in reply to Re^2: Time::HiRes sleep does not always work
in thread Time::HiRes sleep does not always work

Hmph, pesky rounding keeps the decimal from being visible.

Try printing gettimeofday() - time(). My suspicion is that they are exactly the same. And the cause is that at runtime Perl checks whether it can load the system gettimeofday function, and can't find it on one machine but can on another, leading to different results.

Replies are listed 'Best First'.
Re^4: Time::HiRes sleep does not always work
by tone (Novice) on Aug 19, 2008 at 12:34 UTC

    I don't know how I ran the gettimeofday() when you originally asked but this time I'm getting a decimal. So if I run it now I get 1219149022.67188 and I get 0.671875 for gettimeofday() - time()

      Interesting. Don't you love non-deterministic behaviour? Windows likes to do that some times.

      Try your program again, this time checking whether gettimeofday() - time() has changed. See if it works then.