Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
The stupid question is the question not asked
 
PerlMonks  

Re: How to sleep 1 microsecond?

by GrandFather (Cardinal)
on Aug 17, 2012 at 08:06 UTC ( #987932=note: print w/ replies, xml ) Need Help??


in reply to How to sleep 1 microsecond?

What are you trying to achieve with a 1us sleep? Even if you do find code that can achieve that some of the time, it will be highly unreliable for most common operating systems.

True laziness is hard work


Comment on Re: How to sleep 1 microsecond?
Re^2: How to sleep 1 microsecond?
by Anonymous Monk on Aug 17, 2012 at 08:13 UTC

    Not to mention, the various sleep functions only guarantee that they sleep at least the amount of time specified. You can't really do accurate timing with them.

    Time::HiRes::ualarm might work better though...

      Thanks but the ualarm function is like usleep which is not reliable if I want to count a few microsecond.

Re^2: How to sleep 1 microsecond?
by sophate (Beadle) on Aug 18, 2012 at 10:23 UTC

    Concur that usleep/nanosleep are not reliable in this case :-(

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987932]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2014-04-16 10:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (422 votes), past polls