Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Keep It Simple, Stupid
 
PerlMonks  

Re: How to sleep 1 microsecond?

by lidden (Deacon)
on Aug 17, 2012 at 13:15 UTC ( #987966=note: print w/ replies, xml ) Need Help??


in reply to How to sleep 1 microsecond?

You cannot use gettimeofday to measure how long you sleep since a call to that function by itself takes too long for your needs.

my @first = gettimeofday; my @second = gettimeofday; say "[@first] [@second] ", $second[1]-$first[1];
Output:
[1345208919 179070] [1345208919 179072] 2


Comment on Re: How to sleep 1 microsecond?
Select or Download Code

Log In?
Username:
Password:

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

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

    April first is:







    Results (485 votes), past polls