Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1.   private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
  2.         {
  3.             test();
  4.         }
  5.  
  6.         private void test()
  7.         {
  8.             while (true)
  9.             {
  10.                 ts = stopWatch.Elapsed;
  11.                 elapsedTime = string.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds,
  12.                    ts.Milliseconds / 10);
  13.                 if (InvokeRequired)
  14.                 {
  15.                     this.Invoke(new Action(() => test()));
  16.                 }
  17.                 else
  18.                 {
  19.                     clockLabel.Text = elapsedTime;
  20.                 }
  21.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement