Timer Control ticking slower than real life in C#
I am making a simple Timer application in windows forms using C#. The problem is when I start the timer, it ticks slightly slower than a real timer. Anyone knows why and how I can solve this?
3 Replies
Here is my code if anyone wants to see it
in the contructor of my form:
Then there is the event:
When you say that it ticks slower than real life, you measured it with another timer?
So, when you used another timer, and that timer counted 1 sec, your timer was still counting?
One thing I would recommend is to not use string interpolation, as you may be allocating a new string every time, although I may be wrong, since I don't remember the specifics in .net
Also, in Windows Forms, is there a way to separate your UI code and your Timer code in different threads?
yes
i make them both run at the sane starting point, and after over 10m I saw a difference
yes i am pretty sure, but i dont know how as I am not familoar with threads