Chromium Code Reviews| Index: sdk/lib/async/future.dart |
| diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart |
| index efa4144186a14e2a2a9536ac506e2ee5494365f0..4691fde5d2074cb8952aeb7b5d6e6535a15b98fb 100644 |
| --- a/sdk/lib/async/future.dart |
| +++ b/sdk/lib/async/future.dart |
| @@ -137,19 +137,22 @@ abstract class Future<T> { |
| /** |
| * Creates a future that completes after a delay. |
| * |
| - * The future will be completed after [milliseconds] have passed with |
| - * the result of calling [value]. If [milliseconds] is 0, it completes at the |
| - * earliest in the next event-loop iteration. |
| + * The future will be completed after the given [duration] has passed with |
| + * the result of calling [value]. If the duration is 0 or less, it completes |
| + * at the earliest in the next event-loop iteration. |
|
Lasse Reichstein Nielsen
2013/02/12 14:53:10
at the earliest -> no sooner than
floitsch
2013/02/13 19:27:30
Done.
|
| * |
| * If calling [value] throws, the created future will complete with the |
| * error. |
| * |
| * See [Completer]s, for futures with values that are computed asynchronously. |
| + * |
| + * *Deprecation note*: this method initially took an [int] as argument (the |
| + * milliseconds to wait). It is now a [Duration]. |
| */ |
| - factory Future.delayed(int milliseconds, T value()) { |
| + factory Future.delayed(var duration, T value()) { |
|
Lasse Reichstein Nielsen
2013/02/12 14:53:10
I'm not opposed to making value optional.
I don't
floitsch
2013/02/13 19:27:30
Done.
|
| _ThenFuture<dynamic, T> future = |
| new _ThenFuture<dynamic, T>((_) => value()); |
| - new Timer(milliseconds, (_) => future._sendValue(null)); |
| + new Timer(duration, () => future._sendValue(null)); |
| return future; |
| } |