Shamelessly adapted from the Perl Cookbook, though I once wrote code like this anyway.$SIG{ALRM} = sub { die "timeout"; }; eval { alarm(60); # shouldn't take more than a minute # do something here alarm(0); # if the last op finished, cancel the alarm }; if ($@ =~ /timeout/) { # you know it didn't finish } else { # continue }
In reply to Re: Process time out
by chromatic
in thread Process time out
by muppetBoy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |