I am calling two timers in one WinForm for different processes, both are using the same try-catch format. It works fine for the first few days, then starts to become slow. I can see some load on the server. Is my timer event correct? Is this event not putting much load?
In my try-catch, I only stop the timer if my code catches any exception. I doubt if not exception, and my time is not stopped. If I start the timer the second time, it will put more load or its just reset. Please give your valuable advice. Thanks a bunch in advance.
My code is below.
Timer 1 Tick:
private void timerMain_Tick(object sender, EventArgs e)
{
try
{
// Retrieve some status and Update
}
catch (Exception ex)
{
timerMain.Stop();
MessageBoxHelper.ShowException(LanguagePack.LanguageHelper.GetString(GlobalParameters.Language, "Error_ExecutionEx"), ex);
}
finally
{
timerMain.Start();
}
}
Timer 2 Tick:
private void timerWorkStep_Tick(object sender, EventArgs e)
{
try
{
// Retreive Some value from web proxy and set to label
}
catch (Exception ex)
{
timerWorkStep.Stop();
MessageBoxHelper.ShowException(LanguagePack.LanguageHelper.GetString(GlobalParameters.Language, "Error_ExecutionEx"), ex);
}
finally
{
timerWorkStep.Start();
}
}