Пример #1
0
 /// <summary>
 /// 执行任务
 /// </summary>
 private void Run()
 {
     try
     {
         if (!isStop)
         {
             run();
         }
     }
     finally
     {
         if (timerPeriodic.PeriodicUnit != TimerPeriodicUnit.Once && !isStop)
         {
             runTime = timerPeriodic.GetNextRunTime(runTime, intervalTicks);
             if (isSkipTime)
             {
                 for (DateTime now = DateTime.Now; runTime <= now; runTime = timerPeriodic.GetNextRunTime(runTime, intervalTicks))
                 {
                     ;
                 }
             }
             SecondTimer.TaskArray.Append(runHandle, runTime, threadMode);
         }
     }
 }
Пример #2
0
 /// <summary>
 /// 执行任务
 /// </summary>
 private void Run()
 {
     try
     {
         if (!isStop)
         {
             run();
         }
     }
     finally
     {
         if (timerPeriodic.PeriodicUnit != TimerPeriodicUnit.Once && !isStop)
         {
             TimerTask.Default.Add(runHandle, runTime = timerPeriodic.GetNextRunTime(runTime, intervalTicks), threadType);
         }
     }
 }