in reply to Re: negative elapsed time? (versions?)
in thread negative elapsed time?

Hi, I am using: perl 5, version 12, subversion 4 (v5.12.4) built for MSWin32-x86-multi-thread This is the sample output I am getting: Value negative in count: 5940052 t3: 1312816368.122099 t4: 1312816368.121128 Negative or zero value: -0.000970840454101563 Value negative in count: 996932 t3: 1312814653.022737 t4: 1312814653.022737 Negative or zero value: 0 Value negative in count: 996929 t3: 1312814653.023484 t4: 1312814653.023484 Negative or zero value: 0 Value negative in count: 996928 t3: 1312814653.024365 t4: 1312814653.024365 Negative or zero value: 0 Value negative in count: 996926 t3: 1312814653.024980 t4: 1312814653.024980 Negative or zero value: 0 Also, I tested in windows production servers, and I am getting these negative or zero values
  • Comment on Re^2: negative elapsed time? (versions?)

Replies are listed 'Best First'.
Re^3: negative elapsed time? (versions?)
by BrowserUk (Patriarch) on Aug 08, 2011 at 15:35 UTC

    Hm. I don't see any problems using 5.14 either:

    C:\perl5.14-64\bin>.\perl.exe \test\junk14.pl Starting loop End of loop

    What versions of Time::HiRes and Windows are you using?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I using Windows 7. My library version is 1.9721

        Please cut&paste the output from this modified version of your script

        #!/usr/bin/perl -w use strict; use Win32; use Time::HiRes; print $], "\n", $Time::HiRes::VERSION, "\n", Win32::GetOSName(); print "\nStarting loop\n"; for ( 1..1e6 ) { my $t3 = Time::HiRes::time(); my $t4 = Time::HiRes::time(); my $t5 = $t4 - $t3; if( $t5 <= 0 ) { print "\n Value negative in count: $_"; print "\n t3: "; printf "%.6f",$t3; print "\n t4: "; printf "%.6f\n",$t4; print "\n Negative or zero value: $t5"; } } print "\nEnd of loop\n";

        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.