It can be somewhere else. Just check where else you use the member
ts
. But better don't —
the whole thing makes no sense at all. You are trying to count what you think is milliseconds in the cycle of what is supposed to be a second. And also, why do you think the timer is accurate enough. You don't need this member at all. You can always get current time using
System.DateTime.Now
. To count remaining time, remember some time and calculate remaining time by subtract operator defined for the type
System.DateTime
.
You also don't need to convert time into minutes, seconds, etc. — it is already done for you. You can get any units you need, either in fractional form (double floating-point type) or in whole integer. And if this is just for showing value on screen, use
System.DateTime.ToString
with appropriate format specifier.
See:
http://msdn.microsoft.com/en-us/library/system.datetime.aspx[
^],
http://msdn.microsoft.com/en-us/library/zdtaw1bw.aspx[
^],
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx[
^],
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[
^].
—SA