From a013c49e7b441d769e6eb1c0f64662ddd0402d3b Mon Sep 17 00:00:00 2001 From: "mcafee%netscape.com" Date: Fri, 12 Oct 2001 00:02:32 +0000 Subject: [PATCH] usage, allow for different exe names, e.g. mozilla or netscape or galeon git-svn-id: svn://10.0.0.236/trunk@105229 18797224-902f-48f8-a5cc-f745e15eee43 --- .../tools/performance/startup/startup-unix.pl | 39 ++++++++++++------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/mozilla/tools/performance/startup/startup-unix.pl b/mozilla/tools/performance/startup/startup-unix.pl index 697607be1d3..bb2dbde9267 100755 --- a/mozilla/tools/performance/startup/startup-unix.pl +++ b/mozilla/tools/performance/startup/startup-unix.pl @@ -2,7 +2,14 @@ # # 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 +# require 5.003; @@ -11,20 +18,22 @@ require "gettime.pl"; use strict; use Cwd; -# -# mozilla file:/foo/startup-test.html?begin=T -# where T = seconds since 1970, e.g.: -# mozilla file:/foo/startup-test.html?begin=999456977000 -# - -{ - # Build up command string. - my $cwd = Cwd::getcwd(); - my $time = Time::PossiblyHiRes::getTime(); - my $cmd = "mozilla \"file:$cwd/startup-test.html?begin=" . $time . "\""; - print "cmd = $cmd\n"; - - # Run the command. - exec $cmd; +sub PrintUsage { + die < +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; }