Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.43 KB | None | 0 0
  1. class App
  2. {
  3.     public bool IsRunning {get; set;}
  4.     private Thread houseKeepingThread;
  5.    
  6.     public void Start()
  7.     {
  8.         this.IsRunning = true;
  9.         this.houseKeepingThread = new Thread(ThreadFunc);
  10.         this.houseKeepingThread.Start();
  11.     }
  12.    
  13.     private void ThreadFunc()
  14.     {
  15.         while (this.IsRunning)
  16.         {
  17.             DoWork();
  18.             // wait for 30 seconds
  19.         }
  20.     }
  21. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement