C#技术百科
问问你的心你有没有信心 做事情要专一坚定,执着
using System.Threading;  
namespace ConsoleThrea
{
    class Program
    {
        static void Main(string[] args)
        {
            Thread thread = new Thread(new ThreadStart(Print));
            thread.Start();
            Thread thread2 = new Thread(new ThreadStart(Print2));
            thread2.Start();
            for (int i = 0; i < 10000; i++)
            {
                Console.WriteLine("{0}main", i.ToString());
              
            }
        }
        public static void Print()
        {
            for (int i = 0; i < 100; i++)
            {
                Console.WriteLine("{0}",i.ToString());
                Thread.Sleep(10);
            }
        }
        public static void Print2()
        {
            for (int i = 0; i < 100; i++)
            {
                Console.WriteLine("{0}---2", i.ToString());
                Thread.Sleep(10);
            }
        }
    }
}
posted on 2008-08-07 20:23  王德田  阅读(418)  评论(0编辑  收藏  举报