-4

TimeSpan in c# is ignoring values after decimals. How to get exact conversion value?

TimeSpan.FromMilliseconds(5.25).TotalSeconds returns 0.005 instead of 0.00525
  • 2
    Possible duplicate of [TimeSpan comparison with millisecond precision](http://stackoverflow.com/questions/26571898/timespan-comparison-with-millisecond-precision) – Rick S May 02 '17 at 17:47
  • TimeSpan does not support partial microsecond resolution in your context and will round. You would need to work with _ticks_ and deal with the actual numbers yourself – Mad Myche May 02 '17 at 18:05

1 Answers1

1

Documentation tells that

Therefore, value will only be considered accurate to the nearest millisecond.

Antti_M
  • 904
  • 10
  • 20