关于以下代码示例,为什么Thread.Sleep使代码按顺序运行,但是如果我删除该行并行运行?
private static void Main(string[] args) => UsageParallel();
public static void UsageParallel() => MainParallel().Wait();
public static async Task MainParallel() => await Task.WhenAll(Named(), Named());
public static async Task Named()
{
Console.WriteLine("named start");
await Task.Delay(2000);
Thread.Sleep(2000);
Console.WriteLine("named end");
}