Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / tools / performance / startup / startup-unix.pl
blob7e9fa8990708320f1fab69a83f37ce2c046e9a9c
1 #!/usr/bin/perl
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
15 # an optimized build.
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);
22 require 5.003;
24 require "gettime.pl";
26 use strict;
27 use Cwd;
29 sub PrintUsage {
30 die <<END_USAGE
31 usage: startup-unix.pl <exe> [<args>]
32 e.g
33 startup-unix.pl ../../../dist/bin/mozilla
34 startup-unix.pl ../../../dist/bin/mozilla -P \"Default User\"
35 END_USAGE
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");
46 print "cmd = $cmd\n";
48 # Run the command.
49 exec $cmd;