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

Unified Diff: sdk/lib/_internal/pub/lib/src/progress.dart

Issue 315063002: Display timeout errors more gracefully. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 6 years, 6 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 | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/lib/src/source/hosted.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/progress.dart
diff --git a/sdk/lib/_internal/pub/lib/src/progress.dart b/sdk/lib/_internal/pub/lib/src/progress.dart
index 059d480ddec659ba6e32ef3fff758c630f4170c8..af7c0afb6e5b534c69817a20705246c69283ca79 100644
--- a/sdk/lib/_internal/pub/lib/src/progress.dart
+++ b/sdk/lib/_internal/pub/lib/src/progress.dart
@@ -8,6 +8,7 @@ import 'dart:async';
import 'dart:io';
import 'log.dart' as log;
+import 'utils.dart';
/// A live-updating progress indicator for long-running log entries.
class Progress {
@@ -60,19 +61,7 @@ class Progress {
}
/// Gets the current progress time as a parenthesized, formatted string.
- String get _time {
- var elapsed = _stopwatch.elapsed;
- var time = "(";
-
- // TODO(rnystrom): Move this somewhere reusable.
- if (elapsed.inMinutes > 0) {
- time += "${elapsed.inMinutes}:";
- }
-
- var s = elapsed.inSeconds % 59;
- var ms = (elapsed.inMilliseconds % 1000) ~/ 100;
- return time + "$s.${ms}s)";
- }
+ String get _time => "(${niceDuration(_stopwatch.elapsed)})";
/// Refreshes the progress line.
void _update() {
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/io.dart ('k') | sdk/lib/_internal/pub/lib/src/source/hosted.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698