M
M
Matsun2017-11-13 10:49:56
C++ / C#
Matsun, 2017-11-13 10:49:56

How to increase Timer.Interval timer period?

Hello colleagues. I use a timer in the program

timer1 = new System.Windows.Forms.Timer();
timer1.Interval = int.Parse(stringSettins[6]) * 1000; // 1 800 000 - 30 минут 600 000 - 10 минут
timer1.Tick += timer1_Tick;
timer1.Enabled = true;

The jamb is that timer1.Tick is of type INT, respectively, I can’t set an interval of more than 30 minutes. And I need an interval of 3-5 hours.
What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Griboks, 2017-11-13
@Griboks

void Start<T>(T interval)
{T time =0;
while(time <interval){Thread.Sleep(1);time++;}
TickEvent();
}
Something like this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question