- Pressing 'h' highlights code snippets
- Pressing 'p' toggles speaker notes
- Pressing 'f' toggles fullscreen viewing
- Pressing 'w' toggles widescreen
- Pressing 'o' toggles overview mode
- Pressing 'ESC' toggles off these goodies
Allows web pages to get detailed timing information about the page load.
Goals:
The API consists of the following specifications:
interface PerformanceResourceTiming : PerformanceEntry { readonly attribute unsigned short initiatorType; readonly attribute double redirectStart; readonly attribute double redirectEnd; readonly attribute double fetchStart; readonly attribute double domainLookupStart; readonly attribute double domainLookupEnd; readonly attribute double connectStart; readonly attribute double connectEnd; readonly attribute double secureConnectionStart; readonly attribute double requestStart; readonly attribute double responseStart; readonly attribute double responseEnd; };
function getImageLoadTimings() { var resourceList = window.performance.getEntriesByType("resource"); for (i = 0; i < resourceList.length; i++) { if (resourceList[i].initiatorType == "img") { alert("Time: " + resourceList[i].responseEnd - resourceList[i].startTime); } } }
Provides a high precision (1 ms) timer and a standard mechanism for buffering and retrieval of timing information with a web developer supplied name.
Interfaces:
Navigation Timing is supported in the following browsers:
Resource Timing and User Timing implementations expected soon.
<script type='text/javascript'> _gaq.push(['_setAccount','UA-XXXX-X']); _gaq.push(['_trackPageview']); </script>
<script type='text/javascript'> _gaq.push(['_setSiteSpeedSampleRate', 50]); _gaq.push(['_trackPageview']); </script>
_gaq.push(['_trackTiming', category, variable, time_ms, opt_label, opt_sample]);
Parameter | Example |
---|---|
category* | "Watch Page" |
variable* | "Social widgets load time" |
time_ms* | 2340 |
opt_label | "logged in users" |
opt_sample | 100 |
function TimeTracker(category, variable, opt_label) { ... } TimeTracker.prototype.send = function() { var timeSpent = this.endTime - this.startTime; window._gaq.push(['_trackTiming', this.category, this.variable, timeSpent, this.label]); return this; } var tt = new TimeTracker('Watch Page', 'Social widgets load time'); makeXhrRequest(url, myCallback, tt); function makeXhrRequest(url, callback, tt) { if (window.XMLHttpRequest) { tt.startTime(); xhr.send(); } } function myCallback(event) { if (target.readyState == 4) { if (target.status == 200) { target.tt.endTime(); target.tt.send(); // Do something with the resource. } } }
Speed Matters!