By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,512 Members | 1,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,512 IT Pros & Developers. It's quick & easy.

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

P: n/a
DR
What is the best possible resolution that C# timing tests can get?
milliseconds? nanoseconds?
Oct 27 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Oct 26, 7:16 pm, "DR" <softwareengineer98...@yahoo.comwrote:
What is the best possible resolution that C# timing tests can get?
milliseconds? nanoseconds?
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

Oct 27 '07 #2

P: n/a
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

Oct 27 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.