是的,它确实。
查看 Reflector 中的代码表明,如果不是Stopwatch.IsHighResolution,那么它将使用滴答计数(在我的环境中,该值是false所以它将使用DateTime.UtcNow.Ticks):
public void Start()
{
if (!this.isRunning)
{
this.startTimeStamp = GetTimestamp();
this.isRunning = true;
}
}
public static long GetTimestamp()
{
if (IsHighResolution)
{
long num = 0L;
SafeNativeMethods.QueryPerformanceCounter(out num);
return num;
}
return DateTime.UtcNow.Ticks;
}
Run Code Online (Sandbox Code Playgroud)