mcafee%netscape.com 4811193545 comments
git-svn-id: svn://10.0.0.236/trunk@105231 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-12 00:15:39 +00:00

48 lines
1.0 KiB
Perl
Executable File

#!/usr/bin/perl
#
# Script to time mozilla startup.
# Feeds in start time as url argument, startup-test.html
# takes this arg and computes the time difference.
# So something like this happens:
#
# mozilla file:/foo/startup-test.html?begin=T
# where T = ms since 1970, e.g.:
# mozilla file:/foo/startup-test.html?begin=999456977124
#
# NOTE: You will get much better results if you install the
# Time::HiRes perl module (urls in gettime.pl) and test
# an optimized build.
#
# For optimized builds, startup-test.html will also dump
# the time out to stdout if you set:
# user_pref("browser.dom.window.dump.enabled", 1);
#
require 5.003;
require "gettime.pl";
use strict;
use Cwd;
sub PrintUsage {
die <<END_USAGE
usage: startup-unix.pl <exe>
END_USAGE
}
{
PrintUsage() if $#ARGV != 0;
# Build up command string.
my $cwd = Cwd::getcwd();
my $time = Time::PossiblyHiRes::getTime();
my $cmd = "@ARGV[0] \"file:$cwd/startup-test.html?begin=" . $time . "\"";
print "cmd = $cmd\n";
# Run the command.
exec $cmd;
}