alarm.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
BEGIN {
chdir 't';
}
BEGIN {
use Config;
}
}
my $start_time = time;
eval {
alarm 3;
# perlfunc recommends against using sleep in combination with alarm.
};
alarm 0;
my $diff = time - $start_time;
# alarm time might be one second less than you said.
my $start_time = time;
eval {
alarm 3;
};
alarm 0;
$diff = time - $start_time;
# alarm time might be one second less than you said.
{
local $TODO = "Why does system() block alarm() on $^O?"
}