tmharish ++
Here is the exact code to timeout for 25 minutes.
use strict; use warnings; use utf8; eval { local %SIG; $SIG{ALRM}= sub{ die "timeout reached, after 25 minutes!\n"; }; alarm 25*60; # 25 minutes. while(1) { sleep(1); print "Hello Perl\n"; } alarm 0; }; alarm 0; if($@) { print "Error: $@\n"; } exit(0);
In reply to Re: CountDownTimer for my perl program,
by vinoth.ree
in thread CountDownTimer for my perl program,
by venky4289
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |