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

Unified Diff: runtime/observatory/lib/utils.dart

Issue 2255613002: Converted Observatory heap-profile element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Better sorting tests 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 | « runtime/observatory/lib/src/service/object.dart ('k') | runtime/observatory/observatory_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/utils.dart
diff --git a/runtime/observatory/lib/utils.dart b/runtime/observatory/lib/utils.dart
index a69af5212ca8fa800ad967cd56f4edb6b81bff36..b8b5bb33bd9ff998e016a549cb417c29c2a89346 100644
--- a/runtime/observatory/lib/utils.dart
+++ b/runtime/observatory/lib/utils.dart
@@ -146,10 +146,16 @@ class Utils {
return x.toStringAsFixed(2);
}
- static String formatDurationInSeconds(Duration x) {
- return formatSeconds(x.inMilliseconds / Duration.MILLISECONDS_PER_SECOND);
+ static String formatMillis(double x) {
+ return x.toStringAsFixed(2);
}
+ static String formatDurationInSeconds(Duration x) =>
+ formatSeconds(x.inMicroseconds / Duration.MICROSECONDS_PER_SECOND);
+
+ static String formatDurationInMilliseconds(Duration x) =>
+ formatMillis(x.inMicroseconds / Duration.MICROSECONDS_PER_MILLISECOND);
+
static bool runningInJavaScript() => identical(1.0, 1);
}
« no previous file with comments | « runtime/observatory/lib/src/service/object.dart ('k') | runtime/observatory/observatory_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698