OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 var measureTime = { |
| 12 isEnabled: localStorage.measureTimeEnabled, |
| 13 |
| 14 startInterval: function(name) { |
| 15 if (this.isEnabled) |
| 16 console.time(name); |
| 17 }, |
| 18 |
| 19 recordInterval: function(name) { |
| 20 if (this.isEnabled) |
| 21 console.timeEnd(name); |
| 22 }, |
| 23 }; |
| 24 |
| 25 measureTime.startInterval('Load.Total'); |
| 26 measureTime.startInterval('Load.Script'); |
OLD | NEW |