xref: /glogg/tools/timer.pl (revision d0deb8b418a07e6bf0c5f7cc803ebd9dfbe35f27)
162819106SNicolas Bonnefon#!/usr/bin/perl
262819106SNicolas Bonnefon
362819106SNicolas Bonnefonuse Time::Local;
462819106SNicolas Bonnefon
562819106SNicolas Bonnefonwhile (<>) {
662819106SNicolas Bonnefon    chomp;
762819106SNicolas Bonnefon    print "$_\n";
862819106SNicolas Bonnefon    if (/^- (\d*):(\d*):(\d*)\.(\d*) /) {
962819106SNicolas Bonnefon        $time = timelocal($3, $2, $1, (localtime)[3,4,5]) + ($4/1000.0);
1062819106SNicolas Bonnefon        # print "$time\n";
11*d0deb8b4SNicolas Bonnefon        if (/DEBUG: FullIndexOperation: Starting the count\.\.\./) {
1262819106SNicolas Bonnefon            $startcount = $time;
1362819106SNicolas Bonnefon            print "$startcount\n";
1462819106SNicolas Bonnefon        }
15*d0deb8b4SNicolas Bonnefon        elsif (/DEBUG: FullIndexOperation: \.\.\. finished counting\./) {
1662819106SNicolas Bonnefon            print "Counting: ",$time-$startcount,"\n";
1762819106SNicolas Bonnefon        }
1862819106SNicolas Bonnefon    }
1962819106SNicolas Bonnefon}
20