Rob*_*cks 17 .net c# multithreading .net-core
我正在将一个库移植到.NET核心并最大化可移植性,我需要消除对System.Threading.Thread和Thread.Sleep的依赖.什么是替代品呢?
小智 55
you can use
Task.Delay(2000).Wait(); // Wait 2 seconds with blocking
await Task.Delay(2000); // Wait 2 seconds without blocking
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16080 次 |
| 最近记录: |