gecko-dev/build/startup-test.html

43 lines
984 B
HTML
Raw Normal View History

<!-- Pick off begin time as a cgi argument and print it out -->
<html>
<head>
<title>Mozilla Startup Timing Test</title>
</head>
<body>
<script>
// Pick off the time from the file URL.
// file:///foo/startup.html?begin=986869269000
function tokenizeQuery() {
var query = {};
var pairs = document.location.search.substring(1).split('&');
for (var i=0; i < pairs.length; i++) {
var pair = pairs[i].split('=');
query[pair[0]] = unescape(pair[1]);
}
return query;
}
// Dump startup time out to console.
function phoneHome() {
var testFoo;
var now = (new Date()).getTime();
var q = tokenizeQuery();
var begin = q['begin'] || 0; // when did perl launch this
var startupTime = now - begin;
document.write('\n\nStartup time = ' + startupTime + ' ms<br>');
if (window.dump) {
2001-04-10 05:24:28 +00:00
dump('\n\n__startuptime,' + startupTime + '\n\n');
}
}
// As soon as page loads, print out time.
window.onload = phoneHome();
</script>
</body>
</html>