V
Valéry Bezençon
Hello,
I would like to measure the time taken by a method to run for performance
tests.
I use the class DateTime and TimeSpan like this:
start = DateTime.Now;
....method execution
ts = DateTime.Now.Substract(start);
ts is of type TimeSpan. I can get the time using
ts.TotalMilisecond;
However the measures are not precise as the resolution, refering to the .NET
doc, is:
System Approximate Resolution
Windows NT 3.5 and later 10 milliseconds
Windows NT 3.1 16 milliseconds
Windows 98 55 milliseconds
Is it possible to have better resolutions, like 1 millisecond (I have
Windows 2000)?
Thanks
Valéry
I would like to measure the time taken by a method to run for performance
tests.
I use the class DateTime and TimeSpan like this:
start = DateTime.Now;
....method execution
ts = DateTime.Now.Substract(start);
ts is of type TimeSpan. I can get the time using
ts.TotalMilisecond;
However the measures are not precise as the resolution, refering to the .NET
doc, is:
System Approximate Resolution
Windows NT 3.5 and later 10 milliseconds
Windows NT 3.1 16 milliseconds
Windows 98 55 milliseconds
Is it possible to have better resolutions, like 1 millisecond (I have
Windows 2000)?
Thanks
Valéry