use IO::File;
use File::Copy;
use Data::Dumper;
-
+use Time::HiRes qw(gettimeofday tv_interval);
use strict;
print_all_fields cltounix unpad is_callsign is_latlong
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
is_prefix dd is_ipaddr $pi $d2r $r2d localdata localdata_mv
+ diffms
);
}
}
+# measure the time taken for something to happen; use Time::HiRes qw(gettimeofday tv_interval);
+sub diffms
+{
+ my $call = shift;
+ my $line = shift;
+ my $ta = shift;
+ my $no = shift;
+ my $tb = shift || [gettimeofday];
+
+ my $a = int($ta->[0] * 1000) + int($ta->[1] / 1000);
+ my $b = int($tb->[0] * 1000) + int($tb->[1] / 1000);
+ my $msecs = $b - $a;
+
+ $line =~ s|\s+$||;
+ my $s = "subprocess stats cmd: '$line' $call ${msecs}mS";
+ $s .= " $no lines" if $no;
+ DXDebug::dbg($s);
+}