Index: sdk/lib/io/process.dart |
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart |
index e3c62e977fe925f71d84a88d342c8902da4b1163..8ceb41d9e7d16a61d188b22901800cdfadccc91d 100644 |
--- a/sdk/lib/io/process.dart |
+++ b/sdk/lib/io/process.dart |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
// for details. All rights reserved. Use of this source code is governed by a |
// BSD-style license that can be found in the LICENSE file. |
@@ -9,6 +9,7 @@ part of dart.io; |
class _ProcessUtils { |
external static _exit(int status); |
external static _setExitCode(int status); |
+ external static _sleep(int millis); |
} |
/** |
@@ -39,6 +40,16 @@ set exitCode(int status) { |
} |
/** |
+ * Sleep for the duration specified in [duration]. |
+ * |
+ * Use this with care, as no asynchronous operations can be processed |
+ * in a isolate while it is blocked in a [sleep] call. |
+ */ |
+void sleep(Duration duration) { |
+ _ProcessUtils._sleep(duration.inMilliseconds); |
+} |
+ |
+/** |
* [Process] is used to start new processes using the static |
* [start] and [run] methods. |
*/ |