projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new bands.pl and Spot deduping
[spider.git]
/
perl
/
WCY.pm
diff --git
a/perl/WCY.pm
b/perl/WCY.pm
index 1df87e802b907d56e237d3d61686e8052cf6761b..ef536ddb2fa8681c986766f67537f84d1cc7fefb 100644
(file)
--- a/
perl/WCY.pm
+++ b/
perl/WCY.pm
@@
-16,6
+16,7
@@
use Julian;
use IO::File;
use DXDebug;
use Data::Dumper;
use IO::File;
use DXDebug;
use Data::Dumper;
+use Time::HiRes qw(gettimeofday tv_interval);
use strict;
use strict;
@@
-64,9
+65,10
@@
sub init
$fp = DXLog::new('wcy', 'dat', 'm');
do "$param" if -e "$param";
# read in existing data
$fp = DXLog::new('wcy', 'dat', 'm');
do "$param" if -e "$param";
# read in existing data
+ my $t0 = [gettimeofday];
@cache = readfile($main::systime);
shift @cache while @cache > $maxcache;
@cache = readfile($main::systime);
shift @cache while @cache > $maxcache;
- dbg(sprintf "WCY read in last %d records into cache
", scalar @cache);
+ dbg(sprintf "WCY read in last %d records into cache
%dmS", scalar @cache, _diffms($t0));
confess $@ if $@;
}
confess $@ if $@;
}
@@
-171,7
+173,7
@@
sub search
my $count;
my $i;
my $count;
my $i;
- if ($t == $main::systime && ($to
<= $max
cache)) {
+ if ($t == $main::systime && ($to
&& $to <= @
cache)) {
dbg("using wcy cache") if isdbg('wcy');
@out = reverse @cache;
pop @out while @out > $to;
dbg("using wcy cache") if isdbg('wcy');
@out = reverse @cache;
pop @out while @out > $to;