PromiseHelper.cs
17 lines
| 420 B
| text/x-csharp
|
CSharpLexer
/ Implab.Test / PromiseHelper.cs
cin
|
r11 | using Implab.Parallels; | ||
using System; | ||||
cin
|
r10 | using System.Collections.Generic; | ||
using System.Linq; | ||||
using System.Text; | ||||
using System.Threading; | ||||
namespace Implab.Test { | ||||
class PromiseHelper { | ||||
public static Promise<T> Sleep<T>(int timeout, T retVal) { | ||||
return AsyncPool.Invoke(() => { | ||||
Thread.Sleep(timeout); | ||||
return retVal; | ||||
}); | ||||
} | ||||
} | ||||
} | ||||