Timer start time and end time calculation gives 4 secs extra

后端 未结 2 1557
-上瘾入骨i
-上瘾入骨i 2021-01-24 19:49

i am working on WP8 , i am using timer where i am calulating the total time.

This is how i am doing it:

timer = new DispatcherTimer();
 timer.Interval =          


        
2条回答
  •  感动是毒
    2021-01-24 20:18

    You are using the wrong tool for calculating time. You should StopWatch instead of timer. Timer is used to do something that is meant to happen at a regular interval.

提交回复
热议问题