Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use same timer for different time intervals?

Tags:

c#

winforms

I am using a timer in my code. Status bar updates in tick event on clicking respective button for the time inteval mentioned in properties say one second. Now i want to use the same timer for a different time interval say two seconds for a different oepration. How to achieve that?

like image 757
ghd Avatar asked Dec 17 '10 08:12

ghd


1 Answers

Create a second timer. There is nothing to gain from hacking the first timer.

As @Henk noted, Timers are not that expensive. (Especially not compared to fixing hard to maintain code!)

like image 161
Mitch Wheat Avatar answered Sep 17 '22 15:09

Mitch Wheat