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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2288853002: DevTools: Show small times in microseconds (Closed)
Patch Set: Created 4 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
index c5714f56dc119e77f9722b7264ed33349b319af8..507457672cb24e2790116e0acceeb1616f9ab83f 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -586,6 +586,9 @@ Number.preciseMillisToString = function(ms, precision)
}
/** @type {!WebInspector.UIStringFormat} */
+WebInspector._microsFormat = new WebInspector.UIStringFormat("%.0f\u2009\u03bcs");
+
+/** @type {!WebInspector.UIStringFormat} */
WebInspector._subMillisFormat = new WebInspector.UIStringFormat("%.2f\u2009ms");
/** @type {!WebInspector.UIStringFormat} */
@@ -616,9 +619,11 @@ Number.millisToString = function(ms, higherResolution)
if (ms === 0)
return "0";
+ if (higherResolution && ms < 0.1)
+ return WebInspector._microsFormat.format(ms * 1000);
if (higherResolution && ms < 1000)
return WebInspector._subMillisFormat.format(ms);
- else if (ms < 1000)
+ if (ms < 1000)
return WebInspector._millisFormat.format(ms);
var seconds = ms / 1000;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698