【发布时间】:2012-01-19 15:38:58
【问题描述】:
我有一个结构如下的背景刻度函数:
System.Threading.Thread myTimerThread = new Thread(this.Tick);
private void Tick(){
do{
//do stuff
System.Threading.Sleep(1000L);
}while(true)
}
但是,还有一个 System.Threading.Timer 类可以为我执行此操作。使用 System.Threading 中的内置 Timer 类与使用 Tick 函数创建自己的后台线程有什么区别?
【问题讨论】:
标签: c# .net multithreading timer