about:startup - display timings in milliseconds instead of microseconds
authorDaniel Brooks <db48x@db48x.net>
Sun, 12 Sep 2010 10:34:42 -0400
changeset 58834 cce7ee266da0f09d71239d469e90786a0588825a
parent 58833 26b25563cab6e0563b92a44aed59b3539efc0e15
child 58835 8ebd4ef668962e2d8e5b7ba6307d4502e14eaf1f
push id17440
push userdb48x@yahoo.com
push dateWed, 08 Dec 2010 04:15:54 +0000
treeherdermozilla-central@a89f24bf1798 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
about:startup - display timings in milliseconds instead of microseconds
toolkit/content/aboutStartup.js
--- a/toolkit/content/aboutStartup.js
+++ b/toolkit/content/aboutStartup.js
@@ -13,24 +13,25 @@ displayTimestamp("started", startup = ru
 if (launched)
   displayDuration("started", startup - launched);
 
 let ss = Cc["@mozilla.org/browser/sessionstartup;1"].getService(Ci.nsISessionStartup);
 displayTimestamp("restored", restored = ss.restoredTimestamp);
 displayDuration("restored", restored - startup);
 
 function displayTimestamp(id, µs) document.getElementById(id).textContent = formatstamp(µs);
-function displayDuration(id, µs) document.getElementById(id).nextSibling.textContent = formatµs(µs);
+function displayDuration(id, µs) document.getElementById(id).nextSibling.textContent = formatms(msFromµs(µs));
 
-function formatstamp(µs) new Date(µs/1000) +" ("+ formatµs(µs) +")";
+function msFromµs(µs) µs / 1000;
+function formatstamp(µs) new Date(msFromµs(µs)) +" ("+ formatms(msFromµs(µs)) +")";
 function formatµs(µs) µs + " µs";
 function formatms(ms) ms + " ms";
 
-function point(stamp, µs, v, b) [stamp / 1000, µs / 1000, { appVersion: v, appBuild: b }];
-function range(a, b) ({ from: a / 1000, to: (b || a) / 1000 });
+function point(stamp, µs, v, b) [msFromµs(stamp), msFromµs(µs), { appVersion: v, appBuild: b }];
+function range(a, b) ({ from: msFromµs(a), to: msFromµs(b || a) });
 function mark(x, y) { var r = {}; x && (r.xaxis = x); y && (r.yaxis = y); return r };
 function major(r) { r.color = "#444"; return r; }
 function minor(r) { r.color = "#AAA"; return r; }
 function label(r, l) { r.label = l; return r; }
 function majorMark(x, l) label(major(mark(range(x))), l);
 function minorMark(x, l) label(minor(mark(range(x))), l);
 function extensionMark(x, l) label(mark(range(x)), l);
 
@@ -90,19 +91,19 @@ query.executeAsync({
           options.grid.markings.push(minorMark(stamp, "Firefox "+ version +" ("+ build +")"));
 
       lastver = version;
       lastbuild = build;
       var l, s;
       series[1].data.push(point(stamp, l = row.getResultByName("launch"), version, build));
       series[0].data.push(point(stamp, l + (s = row.getResultByName("startup")), version, build));
       table.appendChild(tr(td(formatstamp(stamp)),
-                           td(formatµs(l)),
-                           td(formatµs(s)),
-                           td(formatµs(l + s)),
+                           td(formatms(msFromµs(l))),
+                           td(formatms(msFromµs(s))),
+                           td(formatms(msFromµs((l + s)))),
                            td(version),
                            td(build),
                            td(row.getResultByName("platformVersion")),
                            td(row.getResultByName("platformBuild"))));
     }
   },
   handleError: function(error)
   {