in reply to Simple question about sleep function

In addition to all the other good answers- "sleep(1)" is more portable than the "select(undef...)" call- something to consider when writing code that might be run elsewhere.

And for portable sub-second waiting, there's Time::HiRes.

The only reason to use the "select" version for pausing these days is for sub-second precision on embedded systems, where space is at a premium.

  • Comment on Re: Simple question about sleep function