多线程超简单应用法
超简单的多线程应用。原来如此啊
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace shixia

{
class Program
{
static void Main(string[] args)
{
Thread myThread= new Thread(new ThreadStart(Shu));
myThread.Name = "aa";
myThread.Start();
Thread myThread1 = new Thread(new ThreadStart(Shu1));
myThread1.Name = "aa1";
myThread1.Start();
}
static void Shu()
{
for (int i = 0; i < 10; i++)
{
Console.WriteLine("d");
Thread.Sleep(1000);
}
}
static void Shu1()
{
for (int i = 0; i < 10; i++)
{
Console.WriteLine("f");
Thread.Sleep(1000);
}
}
}
}
浙公网安备 33010602011771号