📜  c#代码示例中如何判断Task.Run是否在循环内完成

📅  最后修改于: 2022-03-11 14:48:41.181000             🧑  作者: Mango

代码示例1
System.Threading.Tasks.Task
.Run(() => 
{
    // simulate processing
    for (var i = 0; i < 10; i++)
    {
        Console.WriteLine("do something {0}", i + 1);
    }
})
.ContinueWith(t => Console.WriteLine("done."));