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

Unified Diff: Source/devtools/front_end/FlameChart.js

Issue 23924003: Support submillisecond times on FlameChart (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/devtools/front_end/CPUProfileView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/FlameChart.js
diff --git a/Source/devtools/front_end/FlameChart.js b/Source/devtools/front_end/FlameChart.js
index f676621e7c8717853a6e98ac2bb07058766afc43..f614603144c5316dfd0c56acd74e98cdb32c9a56 100644
--- a/Source/devtools/front_end/FlameChart.js
+++ b/Source/devtools/front_end/FlameChart.js
@@ -448,6 +448,15 @@ WebInspector.FlameChart.prototype = {
this._scheduleUpdate();
},
+ _millisecondsToString: function(ms)
+ {
+ if (ms === 0)
+ return "0";
+ if (ms < 1000)
+ return WebInspector.UIString("%.1f\u2009ms", ms);
+ return Number.secondsToString(ms / 1000, true);
+ },
+
_prepareHighlightedEntryInfo: function()
{
if (this._isDragging)
@@ -470,8 +479,11 @@ WebInspector.FlameChart.prototype = {
pushEntryInfoRow(WebInspector.UIString("Name"), node.functionName);
if (this._cpuProfileView.samples) {
- pushEntryInfoRow(WebInspector.UIString("Self time"), Number.secondsToString(entry.selfTime / 1000, true));
- pushEntryInfoRow(WebInspector.UIString("Total time"), Number.secondsToString(entry.duration / 1000, true));
+ var rate = this._cpuProfileView.samplesPerMs;
+ var selfTime = this._millisecondsToString(entry.selfTime / rate);
+ var totalTime = this._millisecondsToString(entry.duration / rate);
+ pushEntryInfoRow(WebInspector.UIString("Self time"), selfTime);
+ pushEntryInfoRow(WebInspector.UIString("Total time"), totalTime);
}
if (node.url)
pushEntryInfoRow(WebInspector.UIString("URL"), node.url + ":" + node.lineNumber);
« no previous file with comments | « Source/devtools/front_end/CPUProfileView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698