问题
Is there way to fire the System.Timers.Timer.Elapsed only after the previous Elapsed event has finished?
回答1:
A common pattern to avoid this.
- Start the timer
- Stop it in the beginning of the handler
- Start it again at the end of the handler
This guarantees you can only ever be processing the handler once.
回答2:
The Timer.Interval property may be helpful for you.
来源:https://stackoverflow.com/questions/5683073/only-fire-timer-event-after-previous-elapsed-event-has-finished-c