From sleep,
May be interrupted if the process receives a signal
You could just go to sleep repeatedly until it's time.
# Optional, but a good idea with short durations. use Time::HiRes qw( sleep time ); sub uninterrupted_sleep { my ($duration) = @_; die if !$duration; my $sleep_till = time() + $duration; while ($duration > 0) { sleep($duration); $duration = $sleep_till - time(); } }
Update: Bug fix. Changed $duration -= to $duration =.
In reply to Re: Why is SIGCHLD affecting sleep?
by ikegami
in thread Why is SIGCHLD affecting sleep?
by jsoverson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |