0
Reply

Performance-of-the-system-threading-timers-in-windows-service in windows 7

vrushali katkade

vrushali katkade

Mar 2 2012 1:34 AM
2.4k


http://www.c-sharpcorner.com/Forums/Thread/137324/performance-of-the-system-threading-timers-in-windows-servic.aspx
from this question answer i have used the resynchronize the timer with the system clock after each interval of a second or longer has elapsed.it's working perfectly in windows XP .
when i have used the same timers in windows 7 then it repeat the timer twice in 1 min if you set the timer inteval to 1 min (second ,hour or milisec)then it will excuted only once in 1 minute .why timers repeated for twice in 1 min.
i set the starting time to start the timers in private DateTime[] _startTime;& set the interval to the
1 miniute in  private TimeSpan[] _interval;
my starting time is 11.00.00 & interval is 1min.
then my timers output is
11.00.00
11.01.00
11.02.00
11.02.59 //extra
11.03.00
11.04.00
.......
11.10.00
11.10.59  //extra
11.11.00

but expected output is
11.00.00
11.01.00
11.02.00
11.03.00
11.04.00
.......
11.10.00
11.11.00
why timers excuted twice in windows 7 & windows server 2008 R2 standard & this timers working very perfectly in windows XP.