3.10. Short SleepsProblemYou need to sleep for less than a second. Solution
Use the select(undef, undef, undef, $time_to_sleep);
Some systems don't support a four-argument use Time::HiRes qw(sleep); sleep($time_to_sleep); Discussion
Here's an example of while (<>) { select(undef, undef, undef, 0.25); print; } Using Time::HiRes, we'd write it as: use Time::HiRes qw(sleep); while (<>) { sleep(0.25); print; } See Also
The documentation for the CPAN modules Time::HiRes and BenchMark; the Copyright © 2001 O'Reilly & Associates. All rights reserved. |
|