2 @perl newWindowStats.bat %1 %2 %3 %4 %5 %6
7 # Get numbers from stdin.
11 if ( /^(\d+\.?\d*)\:\s*nsXULWindow created/ ) {
13 @start[ $#start ] = $1;
15 if ( /^(\d+\.?\d*)\:\s*nsXULWindow loaded and visible/ ) {
18 # Ignore the first two windows (hidden window and first window).
20 # Display simple ascii graph.
21 $len = int ( ( $end[$#end] - $start[$#end] + 0.005 ) * 100 );
22 print '*' x ($len%80), " ", $end[$#end]-$start[$#end],"\n";
27 # Ignore the first two windows (hidden window and first window).
28 foreach $i (3..$#start) {
29 $sum += $end[$i] - $start[$i];
31 $avg = $sum/($#start-2);
32 printf "avg window open time for %d windows: %f\n", $#start-2, $avg;