#!/usr/bin/perl
use Time::HiRes qw ( setitimer ITIMER_REAL time );
my $count;
$SIG{ALRM} = sub { print time, "\n" };
setitimer(ITIMER_REAL, 1, 1);
while (1) {
sleep 1;
}
and it worked fine. If this is reliable, it does the job for me. But I wonder why the first time it only worked for the first iteration...
Thanks!
In reply to Re^2: Waiting for Alarm
by n8ur
in thread Waiting for Alarm
by n8ur
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |