I am trying to set an alarm type call that lets me know if my program has been running for more than 10 minutes. I want the program to continue to work after it sends an alarm or a signal. I thought I could make the following code, but the program stops when the execution time reaches ten minutes.
eval{
local $SIG{ALRM} = sub { die "alarm\n"; };
alarm (600);
--code---
alarm 0;
};
if($@){
print "\Its been ten minutes\n";
}
I want the application to notify me, but to continue working.
source
share