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

  • Thread starter Thread starter DR
  • Start date Start date
D

DR

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

If you look at the stopwatch class in c#
it talks of a limit of 100 nanoseconds.
I gues this depends on hardware etc.

Colin =^.^=
 
colin said:
If you look at the stopwatch class in c#
it talks of a limit of 100 nanoseconds.
I gues this depends on hardware etc.

It should be emphasized that the unit of measurement is
not the same as resolution.

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

Using QueryPerformanceCounter you can measure to the accuracy of the
processor clock. Note that the act of measuring will add some delay, and if
you have a variable clockspeed (notebook powersave, for example) then your
results won't be very nice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top