No, you don't need hours, minutes and seconds. You need the structure
System.TimeSpan
and timing using
System.Diagnostics.Stopwatch
, which is the most accurate tool you can get. See the sample on this page:
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx[
^].
It shows you how to get
TimeSpan
, and the unit of measurements are irrelevant here, you can use any one, in fractional values (
double
) or combination of units; this is up to you. And the accuracy is way better than that you expected. You can examine it using static properties
System.Diagnostics.Stopwatch.Frequency
and
System.Diagnostics.Stopwatch.IsHighResolution
. Looking at your code, I expect you to be surprised. :-)
—SA