è¿ä¸ªéæ±æå¾å¤æ¹æ³å¯ä»¥å®ç°ï¼ç»ä½ ä¸ä¸ªæç®åçæ¹æ³çä¾åï¼
using System;using System.Threading;public class ThreadDemo{ static void Main() { Console.WriteLine("Hello, I'm going to do some time-consuming work..."); for (int i = 0; i < 5; i++) { Thread t = new Thread(Work); t.Start(); t.Join(); } Console.WriteLine("I'm finished all works on my hand. You can do something else."); // Some other works. } static void Work() { // Simulate time-consuming work Thread.Sleep(1000); Console.WriteLine("Working..."); }}
温馨提示:内容为网友见解,仅供参考