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

Unified Diff: sdk/lib/io/timer_impl.dart

Issue 101293006: Revert "Fix VM timer firing too early." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | tests/lib/async/multiple_timer_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/timer_impl.dart
diff --git a/sdk/lib/io/timer_impl.dart b/sdk/lib/io/timer_impl.dart
index 883d09e42488bbefb6614636d2d12a9e363f82c4..a3eb9529a360a177f4e13de35d6f599afc4a1095 100644
--- a/sdk/lib/io/timer_impl.dart
+++ b/sdk/lib/io/timer_impl.dart
@@ -24,12 +24,8 @@ class _Timer extends LinkedListEntry<_Timer> implements Timer {
_Timer timer = new _Timer._internal();
timer._callback = callback;
if (milliSeconds > 0) {
- // Add one because DateTime.now() is assumed to round down
- // to nearest millisecond, not up, so that time + duration is before
- // duration milliseconds from now. Using micosecond timers like
- // Stopwatch allows detecting that the timer fires early.
timer._wakeupTime =
- new DateTime.now().millisecondsSinceEpoch + 1 + milliSeconds;
+ new DateTime.now().millisecondsSinceEpoch + milliSeconds;
}
timer._milliSeconds = repeating ? milliSeconds : -1;
timer._addTimerToList();
« no previous file with comments | « no previous file | tests/lib/async/multiple_timer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698