2 use Time
::Local
('timegm');
14 open($fh, "<", $ARGV[0]) || die "can't open ".$ARGV[0];
21 die "not a decimal number: '$max'";
25 print "TOP $max slowest tests\n";
29 if (m/^testsuite: (.*)/) {
33 if (m/testsuite-\w+:/) {
34 $hash{"$name -> ".($end - $start)} = $end - $start;
38 if (m/^time: (\d\d\d\d)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)/ && $intest) {
39 my $ts=timegm
($6,$5,$4,$3,$2 - 1,$1 - 1900);
47 my @sorted = sort { $hash{$b}<=>$hash{$a} } keys(%hash);
48 $max = @sorted if (($max <= 0) or ($max > @sorted));
49 for my $l (@sorted[0..($max - 1)]) {