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..e1928ae9f329540e65d776dd02968769f858ad3b |
--- /dev/null |
+++ b/chrome/browser/resources/task_manager/measuretime.js |
@@ -0,0 +1,24 @@ |
+// 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.startInterval = function(name) { |
+ if (localStorage.isShowTime) |
arv (Not doing code reviews)
2011/12/20 19:33:57
Does this change? Accessing stuff on localStorage
yoshiki
2011/12/21 05:18:57
Done. The value is stored at the time of initializ
|
+ console.time(name); |
+}; |
+ |
+measuretime.recordInterval = function(name) { |
+ if (localStorage.isShowTime) |
+ console.timeEnd(name); |
+}; |
+ |
+measuretime.startInterval('Load.Total'); |
+measuretime.startInterval('Load.Script'); |