.NET 4.0 System.Timers.Timer seems to not execute the elapsed event after some time

后端 未结 2 691
离开以前
离开以前 2021-01-06 04:37

I have a class that needs to run 24x7. It uses a Timers.Timer to execute an elapsed event in a calculated interval. After some time, 3-5 days, the timer just stops executing

2条回答
  •  难免孤独
    2021-01-06 05:20

    If your system real-time is not very strict, you try to

    if (next > 10)
            {
                return next;
            }
            else
            {
                return 10;
            }
    

提交回复
热议问题