mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 08:13:35 +00:00
43 lines
984 B
HTML
43 lines
984 B
HTML
<!-- 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) {
|
|
dump('\n\n__startuptime,' + startupTime + '\n\n');
|
|
}
|
|
}
|
|
|
|
// As soon as page loads, print out time.
|
|
window.onload = phoneHome();
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|