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

The output for gettimeofday() is 121905424846875

I thought that the problem could be caused by a missing function but Dells are running exactly the same Perl dir as me because he copied my Perl directory (so he didn't have to download all the modules)

  • Comment on Re^2: Time::HiRes sleep does not always work

Replies are listed 'Best First'.
Re^3: Time::HiRes sleep does not always work
by tilly (Archbishop) on Aug 18, 2008 at 12:40 UTC
    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.

      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.