alarm
alarm
alarm SECONDS
alarm
Arranges to have a SIGALRM delivered to this process after the specified number of wallclock seconds has elapsed. If SECONDS is not specified, the value stored in $_
is used. (On some machines, unfortunately, the elapsed time may be up to one second less or more than you specified because of how seconds are counted, and process scheduling may delay the delivery of the signal even further.)
Only one timer may be counting at once. Each call disables the previous timer, and an argument of 0
may be supplied to cancel the previous timer without starting a new one. The returned value is the amount of time remaining on the previous timer.
For delays of finer granularity than one second, the Time::HiRes module (from CPAN, and starting from Perl 5.8 part of the standard distrib