From 369eec2abdadae81760536359acd8e79935c8ebd Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 6 Nov 2015 22:05:30 -0800 Subject: [PATCH] Update usertimingExample.js --- examples/libraries/usertimingExample.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/libraries/usertimingExample.js b/examples/libraries/usertimingExample.js index a1a0800d3d..cceb43435a 100644 --- a/examples/libraries/usertimingExample.js +++ b/examples/libraries/usertimingExample.js @@ -1,16 +1,18 @@ Script.include('usertiming.js'); var timing = loadUserTiming(); //set a mark -timing.performance.mark('firstMark') +timing.performance.mark('firstMark'); //do something that takes time -- we're just going to set a timeout here as an example Script.setTimeout(function() { //and set another mark - timing.performance.mark('secondMark') - //measure time between marks (first parameter is a name for the measurement) + timing.performance.mark('secondMark'); + + //measure time between marks (first parameter is a name for the measurement) timing.performance.measure('howlong', 'firstMark', 'secondMark'); - //you can also get the marks by changing the type below + + //you can also get the marks by changing the type var measures = timing.performance.getEntriesByType('measure'); print('measures:::' + JSON.stringify(measures)) }, 1000)