Timer elapsed event firing twice in C# command line program

If timerInverval is small enough, it might be possible that the Elapsed event is fired twice before you get the chance to stop the clock. You should do

Clock.AutoReset = false;

in order to be notified only once each time you start the timer.

As specified in the Timer Class documentation:

If processing of the Elapsed event lasts longer than Interval, the event might be raised again on another ThreadPool thread. In this situation, the event handler should be reentrant.


You may also consider checking this pattern.