F
fnord
Here's what I've got for the timer:
#################################
# timer
#################################
sub timer
{
$timeout = 180;
$SIG{ALRM} = sub {die;};
eval
{
alarm($timeout);
$start = time();
print "Welcome to the game, here are your letters:\n";
®_roll();
print "\n";
$timeRemaining = $timeout - (time() - $start);
while ($timeRemaining > 0)
{
alarm($timeRemaining);
&input;
}
};
print "\nTime's up!\n";
}
For some reason it's not timing out after 180 seconds, it's running for anywhere from 6 to 9 minutes.
Any ideas as to why?
#################################
# timer
#################################
sub timer
{
$timeout = 180;
$SIG{ALRM} = sub {die;};
eval
{
alarm($timeout);
$start = time();
print "Welcome to the game, here are your letters:\n";
®_roll();
print "\n";
$timeRemaining = $timeout - (time() - $start);
while ($timeRemaining > 0)
{
alarm($timeRemaining);
&input;
}
};
print "\nTime's up!\n";
}
For some reason it's not timing out after 180 seconds, it's running for anywhere from 6 to 9 minutes.
Any ideas as to why?