and if I reduce the sleep parameter to less then 1 second the CPU usage jumps to the sky.
sleep expects a whole number of seconds. Anything less than 1 gets truncated to zero ...unless you use sleep from Time::HiRes. This is documented.
For delays of finer granularity than one second, the Time::HiRes module provides usleep().
In reply to Re: Starting a script according to processes
by ikegami
in thread Starting a script according to processes
by moked
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |