| Index: utils/pub/utils.dart
|
| diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
|
| index 6aef021573c852584606209f93fd363105431079..211b5a7b3ce6c50b1de13615695dc577d4a3d445 100644
|
| --- a/utils/pub/utils.dart
|
| +++ b/utils/pub/utils.dart
|
| @@ -8,6 +8,7 @@
|
| #library('utils');
|
|
|
| #import('dart:crypto');
|
| +#import('dart:isolate');
|
|
|
| /** Thrown by methods that parse text when the text isn't a valid. */
|
| class FormatException implements Exception {
|
| @@ -118,3 +119,12 @@ bool endsWithPattern(String str, Pattern matcher) {
|
| */
|
| String sha1(String source) =>
|
| CryptoUtils.bytesToHex(new SHA1().update(source.charCodes()).digest());
|
| +
|
| +/**
|
| + * Returns a [Future] that completes in [milliSeconds].
|
| + */
|
| +Future sleep(int milliSeconds) {
|
| + var completer = new Completer();
|
| + new Timer(milliSeconds, completer.complete);
|
| + return completer.future;
|
| +}
|
|
|