Alex Rivera | Logout

Will serial calls to Threading.Timer.Change() reset the timer's clock?

Asked 2009-07-14T19:43:09.973
11

If I call Threading.Timer.Change() twice in a row, when will the thread next run?

For example:

myTimer.Change(5000, Timeout.Infinite);
// Only 2 seconds pass.
myTimer.Change(5000, Timeout.Infinite);

After this, will the thread next run in 3 seconds or 5 seconds?

I hope the answer is the latter, that the timer is reset with each call of Change(). If not, I'll need to find a way around this.

Edit
Report

1 Answer

13

It will run in 5 seconds. Calling Change will Reset the initial Count.

answered 2009-07-14T19:45:11.390

Your Answer