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

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

Issue 8993007: WebUI TaskManager: Delay scripts loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: marge with master Created 8 years, 11 months 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/measure_time.js
diff --git a/chrome/browser/resources/task_manager/measure_time.js b/chrome/browser/resources/task_manager/measure_time.js
new file mode 100644
index 0000000000000000000000000000000000000000..9daa1089f2a5ed152b2b6d4b59d3edc615104beb
--- /dev/null
+++ b/chrome/browser/resources/task_manager/measure_time.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 = {
+ isEnabled: localStorage.measureTimeEnabled,
+
+ startInterval: function(name) {
+ if (this.isEnabled)
+ console.time(name);
+ },
+
+ recordInterval: function(name) {
+ if (this.isEnabled)
+ console.timeEnd(name);
+ },
+};
+
+measureTime.startInterval('Load.Total');
+measureTime.startInterval('Load.Script');
« no previous file with comments | « chrome/browser/resources/task_manager/main.js ('k') | chrome/browser/ui/webui/chrome_url_data_manager_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698