c++.netperformancetime-precision

Is there a place that I could look at the .NET Stopwatch code and see what it's doing?


Is there a place that I could look at the .NET Stopwatch code and see what it's doing? I'm trying to match up some C++ code to normalize timestamp that .NET stopwatch provides with QueryPerformance call in C++. (I need to have really good precision if possible, so I need to understand what's actually going on in the .NET Stopwatch calls).

Is the code visible / open somewhere that I can read it online. Is decompiling mscorlib an option? I'm kind of keeping this as a last resort.


Solution

  • Here's what .NET 3.5 does

    http://reflector.webtropy.com/default.aspx/Dotnetfx_Win7_3@5@1/Dotnetfx_Win7_3@5@1/3@5@1/DEVDIV/depot/DevDiv/releases/whidbey/NetFXspW7/ndp/fx/src/Services/Monitoring/system/Diagnosticts/Stopwatch@cs/1/Stopwatch@cs

    The date on the source code is late 2002, so probably most versions of .NET use the same code.