##// END OF EJS Templates
JsonReader optimizations
JsonReader optimizations

File last commit:

r203:4d9830a9bbb8 v2
r236:302ca905c19e v2
Show More
PromiseHelper.cs
22 lines | 663 B | text/x-csharp | CSharpLexer
using Implab.Parallels;
using System.Threading;
namespace Implab.Test {
static class PromiseHelper {
public static IPromise<T> Sleep<T>(int timeout, T retVal) {
return AsyncPool.Invoke((ct) => {
ct.CancellationRequested(ct.CancelOperation);
Thread.Sleep(timeout);
return retVal;
});
}
public static IPromise Sleep(int timeout) {
return AsyncPool.Invoke((ct) => {
ct.CancellationRequested(ct.CancelOperation);
Thread.Sleep(timeout);
return 0;
});
}
}
}