Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DispatchTimer - Prevent the tick event to be triggered if the previous tick is still running
- DispatcherTimer dt = new DispatcherTimer();
- dt.Interval = new TimeSpan(0, 0, 0, 0, 500); // 500 Milliseconds
- dt.Tick += new EventHandler(dt_Tick);
- dt.Start();
- if(!busy) {
- busy = true;
- // some code which could take longer than 500 ms
- busy = false;
- }
Add Comment
Please, Sign In to add comment