Click here to Skip to main content
15,886,075 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Team,
i am using timer to continuous calling some functions in my window form application in C# .but Some randomly after some time like approx (10 days) it stopped working even its tick event is not working.
Do anyone have any idea how to identify my this problem of timer and suggestion to overcome this

Thanks in advance

What I have tried:

i tried this by putting another timer tick event ....

if (timer1.Enabled == false) { timer1.Enabled = true; timer1.Start(); };
Posted
Updated 28-Oct-16 0:12am
v2

If you are using System.Timers.Timer the set AutoReset = true then you don't need to enable and start in your code:
Timer.AutoReset Property (System.Timers)[^]
 
Share this answer
 
The Tick event fires, but doesn't do what you told the event handler to do?
Does the event handler still work if called directly?
You can check if(yourTimer.Tick == null) log(EventHandlerSubscriptionError);
That way you would know if ~somehow~[1] your event handler got unsubscribed from the event.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900