Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Oh Wise ones,
I'm trying to find a command or module where I can specify sleep time
in miliseconds or microseconds.

Thanks

Replies are listed 'Best First'.
Re: Sleep times
by liverpole (Monsignor) on Jan 30, 2007 at 18:01 UTC
    Try Time::HiRes!

    Of course, you can also just do the standard:

    select(undef, undef, undef, .001)
    to sleep for 1 millisecond (or change the value to your liking).

    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
      bearing in mind that IF you use the (potentially) confusing select side-effect, you absolutely should leave a comment explaining exactly what it does, so you (or your successors) don't come back in 6 months and wonder what in the hell that bit of code was supposed to do :o

      __________
      The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.
      - Terry Pratchett

      Thank you kindly, muuuuch appreciated :)
Re: Sleep times
by davorg (Chancellor) on Jan 31, 2007 at 09:42 UTC