G
Guest
Hi,
I have one problem in pausing the timer which i have created from
System.Threading.Timer class.
// I can create a timer that waits one second, then invokes every second by
below code
Timer timer = new Timer(timerDelegate, s,1000, 1000);
// I can also shorten the period. Wait 10 seconds to restart the timer.
(s.tmr).Change(10000,100);
My problem is like this,
Once i specify DueTime, the TimerDelegate will be called after that much
duration.
But If i want to Pause the DueTime and restart it then how can i do it?
In the above semple after 1000 miliseconds the timer delegate will be
executed but if i will pause the program at 500 miliseconds and want to
restart the program exactly after 500 miliseconds then how can I do it?
Please reply.
Thanks,
Dhruvesh
I have one problem in pausing the timer which i have created from
System.Threading.Timer class.
// I can create a timer that waits one second, then invokes every second by
below code
Timer timer = new Timer(timerDelegate, s,1000, 1000);
// I can also shorten the period. Wait 10 seconds to restart the timer.
(s.tmr).Change(10000,100);
My problem is like this,
Once i specify DueTime, the TimerDelegate will be called after that much
duration.
But If i want to Pause the DueTime and restart it then how can i do it?
In the above semple after 1000 miliseconds the timer delegate will be
executed but if i will pause the program at 500 miliseconds and want to
restart the program exactly after 500 miliseconds then how can I do it?
Please reply.
Thanks,
Dhruvesh