Search code examples
c#timespanseconds

Timespan(0,0,secs) or Timespan.FromSeconds(secs)


Is there a difference in the returned values between Timespan(0,0,secs) and Timespan.FromSeconds(secs)?

It seems to me the difference is that FromSeconds accepts a double.


Solution

  • Ultimately no, under the hood, TimeSpan deals with ticks.

    Personally I would prefer to use TimeSpan.FromSeconds as it is completely clear what the intent is.