TimeSpan.FromSeconds
takes a double, and can represent values down to 100 nanoseconds, however this method inexplicably rounds the time to whole milliseconds.>
On the rights of a speculation..
TimeSpan.MaxValue.TotalMilliseconds
is equat to 922337203685477. The number that has 15 digits.double
is precise to 15 digits.TimeSpan.FromSeconds
, TimeSpan.FromMinutes
etc. all go through conversion to milliseconds expressed in double
(then to ticks then to TimeSpan
which is not interesting now)So, when you are creating TimeSpan
that will be close to TimeSpan.MaxValue
(or MinValue
) the conversion will be precise to milliseconds only.
So the probable answer to the question "why" is: to have the same precision all the times.
Further thing to think about is whether the job could have been done better if conversions were done through firstly converting value to ticks expressed in long
.