Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 perusing the Monastery: (13)
As of 2014-12-19 09:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (75 votes), past polls