alarm is useful to interupt other processing at a given time or regular intervals, but if you have nothing else to do but wait for the intervening period, then you are using the wrong tool. Forget alarm and use sleep.
Do something every 10 seconds:
my $deadline = time() + 10; while( 1 ) { sleep 1 while time() < $deadline; $deadline = time() +10; ## Do the something }
In reply to Re: Waiting for Alarm
by BrowserUk
in thread Waiting for Alarm
by n8ur
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |