开发者

.NET System.Timer Question - Event triggered when Timer.Start() is called?

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?开发者_开发技巧


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜