Chromium Code Reviews| 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 = {}; | |
|
arv (Not doing code reviews)
2011/12/21 20:19:43
Why not measureTime?
arv (Not doing code reviews)
2011/12/21 20:19:43
Using an object literal is more concise
var meas
yoshiki
2011/12/22 08:50:31
Done.
yoshiki
2011/12/22 08:50:31
Done.
| |
| 12 | |
| 13 measuretime.isEnabled = localStorage.measureTimeEnabled; | |
| 14 | |
| 15 measuretime.startInterval = function(name) { | |
| 16 if (this.isEnabled) | |
| 17 console.time(name); | |
| 18 }; | |
| 19 | |
| 20 measuretime.recordInterval = function(name) { | |
| 21 if (this.isEnabled) | |
| 22 console.timeEnd(name); | |
| 23 }; | |
| 24 | |
| 25 measuretime.startInterval('Load.Total'); | |
| 26 measuretime.startInterval('Load.Script'); | |
| OLD | NEW |