Chromium Code Reviews| Index: chrome/browser/resources/task_manager/measuretime.js |
| diff --git a/chrome/browser/resources/task_manager/measuretime.js b/chrome/browser/resources/task_manager/measuretime.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f0bbb15c80ff21cf9838f22b932f4ddc2a3ff8fe |
| --- /dev/null |
| +++ b/chrome/browser/resources/task_manager/measuretime.js |
| @@ -0,0 +1,26 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +/** |
| + * @fileoverview Utility methods for measuring loading times. |
| + * |
| + * To be included as a first script in main.html |
| + */ |
| + |
| +var measuretime = {}; |
| + |
| +measuretime.isShowTime = localStorage.isShowTime; |
|
mazda
2011/12/21 05:56:53
localStorage.measureTimeEnabled may be better?
yoshiki
2011/12/21 06:08:48
Done.
|
| + |
| +measuretime.startInterval = function(name) { |
| + if (this.isShowTime) |
| + console.time(name); |
| +}; |
| + |
| +measuretime.recordInterval = function(name) { |
| + if (this.isShowTime) |
| + console.timeEnd(name); |
| +}; |
| + |
| +measuretime.startInterval('Load.Total'); |
| +measuretime.startInterval('Load.Script'); |