SQL Server Timer Source

Recently, I’ve been looking for a way to better understand timings on SQL Server, and have been intrigued to see that SQL Server can use one of several different mechanisms to determine precision and resolution of time.

Windows operating systems support an API named QueryPerformanceCounter which can return microsecond timings. Windows can be configured to use the so-called multimedia timer, via the binary boot configuration data, or BCD, with the /USEPMTIMER option, which returns resolution of up to 10-15 milliseconds.

The following script allows you to see what timer_source SQL Server is using. Since this information is only visible on SQL Server 2008 R2 and above, the script returns no results for SQL Server 2008 and below.

On my system, this returns the following: