Par*_*ice 19
在高分辨率时序方面,它们是相同的.
两者都用这个:
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceCounter(out long PerformanceCount);
Run Code Online (Sandbox Code Playgroud)
还有这个:
[DllImport("Kernel32.dll")]
private static extern bool QueryPerformanceFrequency(out long Frequency);
Run Code Online (Sandbox Code Playgroud)
做潜在的时机.(您可以使用Reflector.NET验证这一点).我使用StopWatch因为它已经是框架的一部分(不需要链接另一个dll),它有比HiPerfTimer更好的功能.