Guest User

Untitled

a guest
Aug 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. DispatchTimer - Prevent the tick event to be triggered if the previous tick is still running
  2. DispatcherTimer dt = new DispatcherTimer();
  3. dt.Interval = new TimeSpan(0, 0, 0, 0, 500); // 500 Milliseconds
  4. dt.Tick += new EventHandler(dt_Tick);
  5. dt.Start();
  6.  
  7. if(!busy) {
  8. busy = true;
  9.  
  10. // some code which could take longer than 500 ms
  11.  
  12. busy = false;
  13. }
Add Comment
Please, Sign In to add comment