How to pause the timer in c#?
Posted
by Jay
on Stack Overflow
See other posts from Stack Overflow
or by Jay
Published on 2010-05-07T04:07:23Z
Indexed on
2010/05/07
4:18 UTC
Read the original article
Hit count: 211
I have a timer in my code and the interval is 10s
When the timer elapsed, I will do some checking, and it may takes more than 10s for checking and some update jobs.
However, if I didn't stop the timer, seems the checking will execute every 10s ... If I call the stop(), seems the timer cannot be start again ... ie something like:
protected void timer_elapsed(object sender, EventArgs args)
{
__timer.Stop();
//Some checking here more than 10s
__timer.Start();
}
I just want another 10s to check again after the before checking is done. anyone can help?
© Stack Overflow or respective owner