That means while perl was busy printing 100 time stamps there was absolutely no change in the time stamp itself. On my maschine every few (4 or 5) values the time stamp changed, but only the minimal step the floating point number could show:

1219059879.53406 1219059879.53407 1219059879.53407 1219059879.53407 1219059879.53407 1219059879.53408 1219059879.53408 1219059879.53408 1219059879.53408 1219059879.53408 1219059879.53408 1219059879.53408 1219059879.53409 1219059879.53409 1219059879.53409 1219059879.53409

That means on my machine there really is a hires timer operating as fast or faster than the resolution of the number I get back. On your machine the loop is either at least 20 times faster than on my machine (very unlikely) or your timer is at least 20 times slower.

Change the 100 in the script to 1000 or more, at least until you see more than one change in the numbers. The difference is the resolution at which your timer works.

For example, if the difference is 0.01, then your timer ticks have a resolution of only 1/100 seconds. My machine above has a resolution of at least 1/50000, i.e. under 20 microseconds


In reply to Re^3: Time::HiRes sleep does not always work by jethro
in thread Time::HiRes sleep does not always work by tone

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.