Link to home
Start Free TrialLog in
Avatar of CodeWrangler
CodeWrangler

asked on

TIMER in C# .Net

If I have a lot of stuff happening in the code that executed when the timer elapses, does the timer wait until the code is executed? in other words, does the timer restart when the code defined in the 'elapsed' function starts executing or ends executing? If it re-starts when the code begins executing is there a way to stop or pause the time while the code is being executed?

void Ttimer_elapsed(..)
{
  ...
  ...
}

proctected override void onstart()... etc

Is simply putting a Ttimer.stop() and Ttimer.start() in the _elapsed code sufficient?
Avatar of Alfredo Luis Torres Serrano
Alfredo Luis Torres Serrano
Flag of United States of America image

Your question is not clear.

The timer event is executed in the period of time defined.

If you stop the timer or pause it the event is not executed.

Once the event start you can not stop it except in the same event.

The timer does not restart at any moment the timer is dependent of the time clock.

Hope this helps
SOLUTION
Avatar of Navneet Hegde
Navneet Hegde
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CodeWrangler
CodeWrangler

ASKER

Thanks for the quick responses. Kaufmed, i think Autoreset is the way to go.. i will test and post back.

Apologies if the question was constructed a bit odd :)