time resolution

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

I'm want to benchmark my program with milliseconds resolution.
How do I get number of millisec between 2 times?

timespan.tostring returns only whole seconds on CF.
..net framework includes millisec.
 
If supported by your platform you can P/Invoke the QueryPerformanceCounter
API, or use the wrapper which is part of the OpenNETCF.Diagnostics.Stopwatch
class in the SDF - www.opennetcf.org/sdf/

Peter
 
Milliseconds are retrieved by calling Environment.TickCount. Sub-ms can be
gotten by P/Invoking QPC as Peter stated.

-Chris
 
Back
Top