Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does System.Timers.Timer.Stop() restart the interval countdown?

Tags:

c#

timer

using System.Timers;

var timer = new Timer();
timer.Interval = 1000;
timer.Start();

// Wait for 500

timer.Stop();
timer.Start();

Here will my interval have 500 left to run or 1000?

like image 994
f1wade Avatar asked Mar 25 '13 14:03

f1wade


1 Answers

Short question, short answer. Your timer will start with a fresh interval of 1000ms after it has been stopped. See also MSDN: System.Timers.Timer.Stop()

like image 124
Spontifixus Avatar answered Oct 25 '22 04:10

Spontifixus