in reply to OT How fast a cpu to overwhelm Time::HiRes

Some versions (of perl?) are buggy and return a low resultion value:

#!/usr/bin/perl use Time::HiRes qw(gettimeofday); for (1..10) { ($secs, $micro) = gettimeofday(); print "$secs.$micro\n"; }

outputs

1133364163.866375 1133364163.866375 1133364163.866375 1133364163.866375 1133364163.882000 1133364163.882000 1133364163.882000 1133364163.882000 1133364163.882000 1133364163.882000

on my ActivePerl 5.8.0

Replies are listed 'Best First'.
Re^2: OT How fast a cpu to overwhelm Time::HiRes
by Anonymous Monk on Nov 30, 2005 at 15:32 UTC
    That's not Perl, that's Windows. If I recall correctly, the timer resolution is only 30msec or so. Cheers, Rob
      That's not Perl, that's Windows.

      Wrong. That's not windows, that early versions of Time::HiRes running on windows that didn't use the correct APIs to get good resolution.

      That said, the timer resolution available under very old versions of windows is very low.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      Even if its a windows issue it still concerns perl code. The question was if you could count on perl to return unique timestamps for consecutive or concurrent calls to Time::HiRes and the answer is obviously no. ;)


      ___________
      Eric Hodges $_='y==QAe=e?y==QG@>@?iy==QVq?f?=a@iG?=QQ=Q?9'; s/(.)/ord($1)-50/eigs;tr/6123457/- \/|\\\_\n/;print;