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

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..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');

Powered by Google App Engine
This is Rietveld 408576698