我想知道是否有一个".net集成“的解决方案来精确测量时间(比如函数的执行时间)?目前,我使用的是Kernel32的PerformanceCounters。
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceCounter(
out long lpPerformanceCount);
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceFrequency(
out long lpFrequency);发布于 2009-02-13 13:58:57
The Stopwatch是一个高分辨率的框架timer类(它可能封装了这个api)。
https://stackoverflow.com/questions/546014
复制相似问题