定时器
定时器1
ThreadPool.RegisterWaitForSingleObject(new AutoResetEvent(true), new WaitOrTimerCallback((obj, b) => { Console.WriteLine("threadId:{0},obj:{1},time:{2}", Thread.CurrentThread.ManagedThreadId, obj, DateTime.Now); }), "hello", 1000, false);
定时器2
用system.threading.Timer.实现, 是对threadPool的封装,完成定时功能。
定时器1,windbg中使用两个io线程
定时器2,两个worker线程