Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Is it possible to issue a perl command to sleep for less than 1 second?

by amarquis (Curate)
on Aug 24, 2007 at 17:33 UTC ( [id://634923]=note: print w/replies, xml ) Need Help??


in reply to Re: Is it possible to issue a perl command to sleep for less than 1 second?
in thread Is it possible to issue a perl command to sleep for less than 1 second?

I'd have never thought up this usage of select. Is it a trick used for fractional second sleeps from before Time:HiRes existed?

  • Comment on Re^2: Is it possible to issue a perl command to sleep for less than 1 second?

Replies are listed 'Best First'.
Re^3: Is it possible to issue a perl command to sleep for less than 1 second?
by zentara (Archbishop) on Aug 25, 2007 at 12:46 UTC
    It's been around forever(since C was created). Most people discover it when first doing a "perldoc -q sleep" and are referred to "perldoc -f select". Ultimately it is based on the c code, where select can be used as a delay if the file descriptors are left undefined. Read "man select" if you want to know how it's magic works.

    Now that you know, you will probably recognize it in alot of code. I usually put an inline comment when I use it, signifying it is used for a delay, so the uninitiated will get it.


    I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-19 05:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found