Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to sleep 1 microsecond?

by lidden (Curate)
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987966]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-12-16 15:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (455 votes). Check out past polls.

    Notices?