【发布时间】:2016-08-18 05:08:41
【问题描述】:
我将此代码用于 C# 服务,“SomeFuction”应该每 6 分钟运行一次,但大约 30 分钟后它会停止。
我在这里缺少什么?我希望它一直运行到我的服务运行,请帮助:(
var timer = new System.Threading.Timer((e) =>
{
try
{ SomeFunction(arg1, arg2, arg3); }
catch
{ return;}
}, null, 0, 360000);
【问题讨论】:
-
您使用 System.Threading.Timer 而不是 System.Timers.Timer 是否有原因?
标签: c#