Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart.async; | 5 part of dart.async; |
| 6 | 6 |
| 7 abstract class Timer { | 7 abstract class Timer { |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Creates a new timer. | 10 * Creates a new timer. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 * This function is equivalent to `new Timer(Duration.ZERO, callback)`. | 50 * This function is equivalent to `new Timer(Duration.ZERO, callback)`. |
| 51 */ | 51 */ |
| 52 static void run(void callback()) { | 52 static void run(void callback()) { |
| 53 new Timer(Duration.ZERO, callback); | 53 new Timer(Duration.ZERO, callback); |
| 54 } | 54 } |
| 55 | 55 |
| 56 /** | 56 /** |
| 57 * Cancels the timer. | 57 * Cancels the timer. |
| 58 */ | 58 */ |
| 59 void cancel(); | 59 void cancel(); |
| 60 | |
| 61 /** | |
| 62 * Returns true if the timer is not done, that is it will run the callback. | |
|
floitsch
2013/07/01 12:49:43
Returns whether the timer is still active.
A non-
zarah
2013/07/01 16:15:35
Done.
| |
| 63 */ | |
| 64 bool get isActive; | |
| 60 } | 65 } |
| 61 | 66 |
| 62 external Timer _createTimer(Duration duration, void callback()); | 67 external Timer _createTimer(Duration duration, void callback()); |
| 63 external Timer _createPeriodicTimer(Duration duration, | 68 external Timer _createPeriodicTimer(Duration duration, |
| 64 void callback(Timer timer)); | 69 void callback(Timer timer)); |
| OLD | NEW |