- 论坛徽章:
- 0
|
原帖由 兰花仙子 于 2009-11-27 15:58 发表
不sleep那叫疯狂循环~
sleep会被信号中断,不会一直在那里死等~
明白!!!! 谢谢仙子!!!!
Any of the bit masks can also be undef. The timeout, if specified, is in seconds, which may be fractional.
Note: not all implementations are capable of returning the $timeleft. If not, they always return $timeleft equal to the supplied $timeout.
You can effect a sleep of 250 milliseconds this way:
select(undef, undef, undef, 0.25);
Note that whether "select" gets restarted after signals (say, SIGALRM) is implementation-dependent. See also perlport for notes on the portability of "select".
[ 本帖最后由 gaochong 于 2009-11-27 16:16 编辑 ] |
|