In the example below, why does the Milliseconds
property return 0
but the TotalMilliseconds
property return 5000
?
// 5 seconds TimeSpan intervalTimespan = new TimeSpan(0, 0, 5); // returns 0 intervalTimespan.Milliseconds; // returns 5000.0 intervalTimespan.TotalMilliseconds
Simple:
Milliseconds
are the remaining milliseconds, that don't form a whole second.TotalMilliseconds
is the complete duration of the timespan expressed as milliseconds.Because Milliseconds
returns the Milliseconds portion, and TotalMilliseconds returns the total milliseconds represented by the Timespan
Example: 0:00:05.047
Milliseconds: 47
Total Milliseconds: 5047
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With