- or download this
# Create the list of filedescriptors to check for activity
$bits = $bobs = '';
...
# end)
}
}
- or download this
use Time::HiRes qw/time/; # Code will work without this, but works bet
+ter with
my @timers;
...
calldata => $calldata };
@timers = sort { $a->{when} <=> $b->{when} } @timers;
}
- or download this
$now = time();
while ($timers[0]->{when} <= $now)
...
&{$timeout->{callback}}($timeout->{calldata});
}
select($rout=$bits, $wout='', $eout='', $timers[0]->{when}-$now);