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

Unified Diff: runtime/observatory/lib/src/elements/cpu_profile.dart

Issue 1287033006: Fix time span in profiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | runtime/vm/profiler_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/cpu_profile.dart
diff --git a/runtime/observatory/lib/src/elements/cpu_profile.dart b/runtime/observatory/lib/src/elements/cpu_profile.dart
index e1d6d47ee632f8119b18e6313c5013ff309db7f2..93ece6626f651f68496b6fc9ed7393ec294b5c2c 100644
--- a/runtime/observatory/lib/src/elements/cpu_profile.dart
+++ b/runtime/observatory/lib/src/elements/cpu_profile.dart
@@ -500,7 +500,11 @@ class SampleBufferControlElement extends ObservatoryElement {
refreshTime = new DateTime.now().toString();
stackDepth = profile.stackDepth.toString();
sampleRate = profile.sampleRate.toStringAsFixed(0);
- timeSpan = formatTime(profile.timeSpan);
+ if (profile.sampleCount == 0) {
+ timeSpan = '0s';
+ } else {
+ timeSpan = formatTime(profile.timeSpan);
+ }
}
void tagSelectorChanged(oldValue) {
« no previous file with comments | « no previous file | runtime/vm/profiler_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698