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 whether the timer is still active. | |
| 63 * | |
| 64 * A non-periodic callback is active if the callback has not been executed, | |
|
floitsch
2013/07/01 17:50:56
My fault should have been:
"A non-periodic timer i
zarah
2013/07/02 11:22:01
Done.
| |
| 65 * and the timer has not been canceled. | |
| 66 * | |
| 67 * A periodic callback is active if it has not been canceled. | |
| 68 */ | |
| 69 bool get isActive; | |
| 60 } | 70 } |
| 61 | 71 |
| 62 external Timer _createTimer(Duration duration, void callback()); | 72 external Timer _createTimer(Duration duration, void callback()); |
| 63 external Timer _createPeriodicTimer(Duration duration, | 73 external Timer _createPeriodicTimer(Duration duration, |
| 64 void callback(Timer timer)); | 74 void callback(Timer timer)); |
| OLD | NEW |