It will not affect anything ...
See this code
class TimerTest
{
static int i = 0;
static void Tick(object sender, EventArgs e)
{
Console.WriteLine(i);
i++;
}
static void Main()
{
Timer tmr = new Timer();
tmr.Interval = 500;
tmr.Elapsed += Tick;
tmr.Start();
Console.ReadLine();
tmr.Start();
Console.ReadLine();
tmr.Stop();
Console.ReadLine();
tmr.Start();
Console.ReadLine();
tmr.Dispose();
}
}
after starting u, if Enter return, the second start will not affect anything.
source
share