You are misleading properties giving the total amount expressed in a given unit , while properties giving a part of the value when you break it down into its components (days, hours, minutes, seconds, milliseconds, ticks).
In doing so, you get an integer remainder for each category. Thus, Milliseconds will always be between 0 and 999 (the number of milliseconds per second is 1).
Or, another example, if you have 72 minutes, TotalMinutes is 72, but Minutes is 12 .
Very much like the DecodeDateTime function to break up a TDateTime .
And for what you want to achieve, you definitely need to use the TotalMilliseconds property, as TridenT pointed out, but the code for GetMilliseconds really correct in TimeSpan .
FranΓ§ois
source share