Cleanup Timer code
git-svn-id: https://svn.perl.org/qpsmtpd/branches/high_perf@444 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
cb047d9aa9
commit
5853c3a011
@ -116,11 +116,8 @@ sub AddTimer {
|
|||||||
my ($secs, $coderef) = @_;
|
my ($secs, $coderef) = @_;
|
||||||
my $timeout = time + $secs;
|
my $timeout = time + $secs;
|
||||||
|
|
||||||
use Data::Dumper; $Data::Dumper::Indent=1;
|
|
||||||
|
|
||||||
if (!@Timers || ($timeout > $Timers[-1][0])) {
|
if (!@Timers || ($timeout > $Timers[-1][0])) {
|
||||||
push @Timers, [$timeout, $coderef];
|
push @Timers, [$timeout, $coderef];
|
||||||
print STDERR Dumper(\@Timers);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +125,6 @@ sub AddTimer {
|
|||||||
for (my $i = 0; $i < @Timers; $i++) {
|
for (my $i = 0; $i < @Timers; $i++) {
|
||||||
if ($Timers[$i][0] > $timeout) {
|
if ($Timers[$i][0] > $timeout) {
|
||||||
splice(@Timers, $i, 0, [$timeout, $coderef]);
|
splice(@Timers, $i, 0, [$timeout, $coderef]);
|
||||||
print STDERR Dumper(\@Timers);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user