4 # Script to time mozilla startup.
5 # Feeds in start time as url argument, startup-test.html
6 # takes this arg and computes the time difference.
7 # So something like this happens:
9 # mozilla file:/foo/startup-test.html?begin=T
10 # where T = ms since 1970, e.g.:
11 # mozilla file:/foo/startup-test.html?begin=999456977124
13 # NOTE: You will get much better results if you install the
14 # Time::HiRes perl module (urls in gettime.pl) and test
17 # For optimized builds, startup-test.html will also dump
18 # the time out to stdout if you set:
19 # user_pref("browser.dom.window.dump.enabled", 1);
31 usage: startup-unix.pl <exe> [<args>]
33 startup-unix.pl ../../../dist/bin/mozilla
34 startup-unix.pl ../../../dist/bin/mozilla -P \"Default User\"
39 PrintUsage() unless $#ARGV >= 0;
40 # Build up command string.
41 my $cwd = Cwd::getcwd();
43 my $cmd = join(' ', map {/\s/ ? qq("$_") : $_} @ARGV);
44 my $time = Time::PossiblyHiRes::getTime();
45 $cmd .= qq( -url "file:$cwd/startup-test.html?begin=$time");