in reply to How do you sleep?

I usually use 4-arg select, because the first time I needed to sleep for a split-second, Time::HiRes didn't exist yet.

Besides, 4-arg select() works the same way it works in C.

Replies are listed 'Best First'.
Re^2: How do you sleep?
by jh- (Scribe) on Jan 27, 2009 at 17:34 UTC
    "Besides, 4-arg select() works the same way it works in C."

    I'm not exactly a C guru, so could you elaborate a bit on what you meant with that? Does select() behave differently on some situations than Time::HiRes::sleep or other alternatives (e.g. how signals are handled)?

      I just mean that it works the same way as in C - same arguments, same behaviour, nothing new to learn.

      I assume (but the documentation doesn't make it clear) that Time::HiRes::sleep suffers from the same problem as CORE::sleep(): on many platforms, sleep() is implemented using alarm().