System.Timers.Timer/Threading.Timer vs Thread with WhileLoop + Thread.Sleep For Periodic Tasks

前端 未结 4 1149
悲&欢浪女
悲&欢浪女 2020-12-02 11:23

In my application I have to send periodic heartbeats to a \"brother\" application.

Is this better accomplished with System.Timers.Timer/Threading.Timer or Using a Th

4条回答
  •  情深已故
    2020-12-02 11:37

    I've found that the only timer implementation that actually scales is System.Threading.Timer. All the other implementations seem pretty bogus if you're dealing with a non trivial number of scheduled items.

提交回复
热议问题