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

Unified Diff: dart/corelib/src/implementation/stopwatch_implementation.dart

Issue 9416065: Stopwatch.elapsed must always increase after start has been called. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | dart/tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/corelib/src/implementation/stopwatch_implementation.dart
diff --git a/dart/corelib/src/implementation/stopwatch_implementation.dart b/dart/corelib/src/implementation/stopwatch_implementation.dart
index 9ec205897b223320f643151dc04c568dc98198f3..e79dc81ea82e1cd6e1f49fa4967f1e611075fecb 100644
--- a/dart/corelib/src/implementation/stopwatch_implementation.dart
+++ b/dart/corelib/src/implementation/stopwatch_implementation.dart
@@ -9,7 +9,8 @@ class StopwatchImplementation implements Stopwatch {
// The _start and _stop fields capture the time when [start] and [stop]
// are called respectively.
// If _start is null, then the [Stopwatch] has not been started yet.
- // If _stop is null, then the [Stopwatch] has not been stopped yet.
+ // If _stop is null, then the [Stopwatch] has not been stopped yet,
+ // or is running.
int _start;
int _stop;
@@ -29,6 +30,7 @@ class StopwatchImplementation implements Stopwatch {
// Restarting this stopwatch. Prepend the elapsed time to the current
// start time.
_start = Clock.now() - (_stop - _start);
+ _stop = null;
}
}
« no previous file with comments | « no previous file | dart/tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698