如何从此计时器的回调函数更改System.Threading.Timer中的间隔?它是否正确?
这样做.没有发生.
public class TestTimer
{
private static Timer _timer = new Timer(TimerCallBack);
public void Run()
{
_timer.Change(TimeSpan.Zero, TimeSpan.FromMinutes(1));
}
private static void TimerCallBack(object obj)
{
if(true)
_timer.Change(TimeSpan.Zero, TimeSpan.FromMinutes(10));
}
}
Run Code Online (Sandbox Code Playgroud)