I know this thread is a bit outdated, but I would like to add more information. First, I agree that QueryPerformanceCounter may take longer on certain machines, but I'm not sure if this is due to Ron. Although I did some research on this issue, I found various web pages that talk about how the QueryPerformanceCounter is implemented. For example, Accuracy is not the same thing as accuracy tells me that Windows HAL will be more specific, will use a different synchronization device to get the value. This means that if a slower synchronization device, such as a PIT, appears in the windows, it takes longer to get the time value. Obviously, using PIT may require a PCI transaction, so this will be one of the reasons.
I also found another article: How it works: Timer output in SQL Server 2008 R2 - Invariant TSC gives a similar description. In fact, this article describes how SQLServer will best perform the transaction.
Then I found more information about the VMware site because I had to deal with clients who use virtual machines, and I found that there are other problems with measuring time with virtual machines. For those who are interested, refer to the VMware article - "Time Tracking in VMware Virtual Machines" This article also talks about how some versions of windows will synchronize each TSC. Thus, it would be safe to use QueryPerformanceCounter () in certain situations, and I think we should try something like this: the timer outputs in SQL Server 2008 R2 suggested finding what could happen when we call the QueryPerformanceCounter ()
istudy0 Sep 03 '10 at 20:11 2010-09-03 20:11
source share