1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 /** 6 * @fileoverview Utility methods for measuring loading times. 7 * 8 * To be included as a first script in main.html 9 */ 10 11 /** 12 * measureTime class 13 * @constructor 14 */ 15 var measureTime = { 16 isEnabled: localStorage.measureTimeEnabled, 17 18 startInterval: function(name) { 19 if (this.isEnabled) 20 console.time(name); 21 }, 22 23 recordInterval: function(name) { 24 if (this.isEnabled) 25 console.timeEnd(name); 26 }, 27 }; 28 29 measureTime.startInterval('Load.Total'); 30 measureTime.startInterval('Load.Script'); 31