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
2010-03-19 00:17:37
Thanks for this Aaronnaught. Yes, I do mean AutoReset. Thanks for the ansywer! :D
mallows98
2010-03-19 01:14:49