lib/javascripts/wbench.js in wbench-0.4.0 vs lib/javascripts/wbench.js in wbench-1.0.0

- old
+ new

@@ -90,7 +90,20 @@ return linkURLs; }, currentURL: function() { return window.location.href; + }, + + performanceTimings: function() { + resultTimings = window.performance.timing; + + // Use user defined timings that are added via window.performance.mark('event name') + if(typeof(window.performance.getEntriesByType) === 'function') { + window.performance.getEntriesByType('mark').forEach(function(item) { + resultTimings[item.name] = Math.ceil(window.performance.timing.navigationStart + item.startTime); + }); + }; + + return resultTimings; } }