class Program
{
static public void test()
{
Console.WriteLine("任务开始");
Thread.Sleep(3000);
Console.WriteLine("任务结束");
}
static void Main(string[] args)
{
Task tk = new Task(test);
tk.Start();
TaskFactory tf = new TaskFactory();
tf.StartNew(test);
Console.ReadKey();
}
}
浙公网安备 33010602011771号