Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4294)

Unified Diff: chrome/browser/resources/task_manager/measuretime.js

Issue 8993007: WebUI TaskManager: Delay scripts loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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');

Powered by Google App Engine
This is Rietveld 408576698