Groups | Blog | Home
all groups > vb.net > october 2007 >

vb.net : What is the best possible resolution that C# timing tests can get? milliseconds? nanoseconds?


DR
10/26/2007 6:16:20 PM
What is the best possible resolution that C# timing tests can get?
milliseconds? nanoseconds?

Tom Shelton
10/26/2007 9:38:58 PM
[quoted text, click to view]

Well, I'm not sure what C# has to do with it - especially since this
is a VB.NET group.... But, probably the best class to use for timing
code and such is System.Diagnostics.StopWatch. I believe this class
wraps QueryPerformanceFrequency and QueryPerformanceCounter API's -
which on most hardware should give millisecond resolution.

--
Tom Shelton
Cor Ligthert[MVP]
10/27/2007 12:00:00 AM
However,

As addition to Tom, has to be done more times on Windows Operating systemst,
because there is mostly a lot of processing in the background, even if you
did not start that yourself.

Therefore the results are very insecure even in milliseconds.

Cor
AddThis Social Bookmark Button