Alternatives to Thread.Sleep()

后端 未结 11 1279
清歌不尽
清歌不尽 2020-11-27 03:48

Every N minutes we want to run through a list of tasks. So we\'ve created a task executor with a

do { DoWork(); }while(!stopRequested)

No

11条回答
  •  生来不讨喜
    2020-11-27 04:15

    You could use an ManualResetEvent that you set when it's time to stop, and then do a WaitOne on it.

提交回复
热议问题