Advertisement:

Skystone Software

http://www.SkystoneSoftware.com

Scott Waletzko's Blog
Averaging TimeSpan Values
Published: 3/9/2008
XMl / RSS

Quick and easy tip today because I'm still reeling a little bit from moving the clocks forward overnight (stupiid Daylight Savings Time). if you want to find the average of a collection of TimeSpan values, add them together, divide the Ticks property of the summed value by the total number of TimeSpans you had in the collection, and then create a new TimeSpan using that value as the initializer.



Questions or Comments? .

VB to C# and C# to VB translation provided by Instant C# and Instant VB.