C# Timespan Milliseconds vs TotalMilliseconds
问题 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 回答1: Simple: Milliseconds are the remaining milliseconds, that don't form a whole second. TotalMilliseconds is the complete duration of the timespan expressed as milliseconds. 回答2: Because Milliseconds returns the