projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
force update of talk command
[spider.git]
/
perl
/
Timer.pm
diff --git
a/perl/Timer.pm
b/perl/Timer.pm
index 683497d2d328f889f6d1ac6f1aaf9538587b3a4a..fb429f643537d40cd204b367c93ed5f962cd74df 100644
(file)
--- a/
perl/Timer.pm
+++ b/
perl/Timer.pm
@@
-3,19
+3,21
@@
#
# This uses callbacks. BE CAREFUL!!!!
#
#
# This uses callbacks. BE CAREFUL!!!!
#
-#
$Id$
+#
#
# Copyright (c) 2001 Dirk Koopman G1TLH
#
package Timer;
#
# Copyright (c) 2001 Dirk Koopman G1TLH
#
package Timer;
-use vars qw(@timerchain $notimers);
+use vars qw(@timerchain $notimers
$lasttime
);
use DXDebug;
@timerchain = ();
$notimers = 0;
use DXDebug;
@timerchain = ();
$notimers = 0;
+$lasttime = 0;
+
sub new
{
my ($pkg, $time, $proc, $recur) = @_;
sub new
{
my ($pkg, $time, $proc, $recur) = @_;
@@
-39,7
+41,9
@@
sub del
sub handler
{
my $now = time;
sub handler
{
my $now = time;
-
+
+ return unless $now != $lasttime;
+
# handle things on the timer chain
my $t;
foreach $t (@timerchain) {
# handle things on the timer chain
my $t;
foreach $t (@timerchain) {
@@
-48,6
+52,8
@@
sub handler
$t->{t} = $now + $t->{interval} if exists $t->{interval};
}
}
$t->{t} = $now + $t->{interval} if exists $t->{interval};
}
}
+
+ $lasttime = $now;
}
sub DESTROY
}
sub DESTROY