Yes, that is a simple method. See select, where it states:
You can effect a sleep of 250 milliseconds this way:
select(undef, undef, undef, 0.25);
| [reply] [d/l] |
I'd have never thought up this usage of select. Is it a trick used for fractional second sleeps from before Time:HiRes existed?
| [reply] |
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.
| [reply] |