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..ddd9a55408f815039b3e77a9ccbb2c52dead211d |
--- /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 = {}; |
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.
|
+ |
+measuretime.isEnabled = localStorage.measureTimeEnabled; |
+ |
+measuretime.startInterval = function(name) { |
+ if (this.isEnabled) |
+ console.time(name); |
+}; |
+ |
+measuretime.recordInterval = function(name) { |
+ if (this.isEnabled) |
+ console.timeEnd(name); |
+}; |
+ |
+measuretime.startInterval('Load.Total'); |
+measuretime.startInterval('Load.Script'); |