using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
namespace TaskWaitTesting
{
class Program
{
private static Random R = new Random();
static void Main(string[] args)
{
TestWait();
//TestWaitAll(RetrieveTasks(10));
//TestWhenAll(RetrieveTasks(10));
//TestWaitAny(RetrieveTasks(10));
//TestWhenAny(RetrieveTasks(10));
// 主线程
while (true)
{
Console.WriteLine("Main thread is working...");
Thread.Sleep(2000);
}
}
private static void TestWait()
{
Console.WriteLine(string.Format("================{0}================", MethodBase.Get
c# - Task Wait WaitAll WhenAll WhenAny
最新推荐文章于 2024-05-22 23:04:04 发布