tags:

views:

38

answers:

1

When a timer's autostart is set to true, does it execute the elapsed event automatically, or just wait for the elapsed interval then executes the event?

+5  A: 

I assume you mean the Timer.Start method in the System.Timers.Timer class, and the answer is no, Elapsed doesn't get fired until the first interval actually elapses.

Note: If by Autostart you actually mean AutoReset, then that property automatically stops the timer after the first Elapsed event is fired. It has no direct effect on what the Start method does.

Aaronaught
Thanks for this Aaronnaught. Yes, I do mean AutoReset. Thanks for the ansywer! :D
mallows98