c# System.Threading.Timer是多线程,并能同时执行

public static void RunTimerTimer(object Sender)
{
Console.WriteLine(String.Format("BeginSleep ID:{0} Tick:{1}", Thread.CurrentThread.ManagedThreadId, HUtil32.GetTickCount()));
Thread.Sleep(200);
Console.WriteLine(String.Format("EndSleep ID:{0} Tick:{1}", Thread.CurrentThread.ManagedThreadId, HUtil32.GetTickCount()));
}

unsafe static void Main(string[] args)
{


System.Threading.Timer RunTimer = new System.Threading.Timer(new TimerCallback(RunTimerTimer), null, 0, 100);





Console.ReadKey();
}

会出现:
多个Begin然后End

你可能感兴趣的:(c#)