The way I read the (uncut) man page quote leads me to believe the mentioned drift only occurs when "adjusting the system clock (either manually or by services like ntp)".

At I ran the following code:

perl -le"use Time::HiRes qw( time ); print time while <>

I pressed enter at 4:39:00, 4:44:00 and 4:56:00.

1185395940.27216 1185396239.78586 1185396960.49883

Time 1 and Time 2:
Clock time difference: 300 seconds
HiRes time difference: 299.5137 seconds
Drift: 0.09726 HiRes second per Clock minute

Time 1 and Time 3:
Clock time difference: 1020 seconds
HiRes time difference: 1020.22667 seconds
Drift: 0.01333 HiRes second per Clock minute

You mentioned a drift of 0.5 HiRes second per Clock minute. I am simply not seeing that. The error is surely due to the variance in my response time.

By the way, old versions of Time::HiRes (< 1.53) had notorisouly bad resolution on Windows. Are you using something recent?


In reply to Re: Time::HiRes (un)reliability in Windows/Cygwin ?? by ikegami
in thread Time::HiRes (un)reliability in Windows/Cygwin ?? by graff

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.