A TimeSpan for C # represents a time when DateTime represents a point in time. TimeSpan can be negative, can be added to the datetime and reduced, very convenient, I like. In the code we often want to express a period of time, with a unified unit (time or minutes or seconds), not the unit is too large, is too small, often more inconvenient. TimeSpan support from the string Parse, using our custom "When: minutes: Seconds" format, is very convenient.
TimeSpan ts1 = Timespan.parse ("-367.0:1:30.5"); TimeSpan ts2= Timespan.parse ("-367.0:1:30"); TimeSpan Ts3= Timespan.parse ("0:1:30.5"); TimeSpan TS4= Timespan.parse ("0:1:30"); TimeSpan TS5= Timespan.parse ("0:1");//represents 1 minutes instead of 1 seconds
TimeSpan supports all of the above formats and is flexible. Of course, these are just the usual ones.
Later in the code boldly use the timespan read from CONFIG. If you like it, you can have a nice ^_^
Read from configuration for a period of time (TimeSpan)