Example #1
0
 public async void Start()
 {
     BackColor = Color.Transparent;
     if (runTime.TotalSeconds > 0 && tub.status != Tube.Status.Done)
     {
         await Task.Run(() =>
         {
             tub.status = Tube.Status.Testing;
             if (cyclingEnable)
             {
                 tub.DutyCycle(onTime, offTIme);
             }
             else
             {
                 tub.on = true;
             }
             Stopwatch sw = new Stopwatch();
             sw.Start();
             while (sw.ElapsedMilliseconds < (int)(settlingTime * 1000))
             {
                 Application.DoEvents();
             }
             sw.Stop();
             runTimer.Start();
         });
     }
 }