public void Start(int maxCycle = 0)
{
if (this.running) { return; }
if (timer == null)
{
timer = new System.Timers.Timer(interval); //实例化Timer类,设置间隔时间为10000毫秒;
timer.Elapsed += new System.Timers.ElapsedEventHandler(Tick); //到达时间的时候执行事件;
timer.AutoReset = true; //设置是执行一次(false)还是一直执行(true);
}
this.currentCycle = 0;
this.maxCycle = maxCycle;
Time.Set();
timer.Enabled = true; //是否执行System.Timers.Timer.Elapsed事件;
this.running = true;
}