Timer Resolution

Today I wanted to talk about an item of software that’s hit and miss with a lot of fans, a tool called “Timer Resolution” by Lucas Hale. This is a tool that changes the Windows Timer Resolution, how often Windows checks to see if any pending timers need to be triggered, and one of the side effects of this is that the current task is temporarily halted and the context switcher checks to see which task is the next one that should run. By default the smallest timer accuracy you can get in Windows is about 15 milliseconds, but Windows is capable of much better, around 0.5 milliseconds in Vista and above, and this tool lets you control that directly. Of course usually you’ll get a slightly better value since many items of software request a 1 millisecond resolution for themselves and because this affects the Windows process directly, the lowest value will always apply system wide.

The reason that this tool is interesting is that applications don’t always request the value that will give them the best performance. Possibly the programmers didn’t think of it, it may not have been an issue for the processors or workloads the application was tested with or they simply didn’t want to drain battery life or cause inefficiencies in other applications. Regardless of the reason, people have found out that various PC games do perform better with a higher timer resolution, as will any browser executing Javascript and any batch script that handles a large amount of small files for processing. The reason for this is that when a thread finishes it’s work or otherwise is waiting for input, either from a different thread or from an external source like the disk or a network device, it can’t really do anything else. In some cases an application is set up to yield to a different thread when this happens, but often this isn’t practical. A higher timer resolution means the operating system is checking on all it’s threads more often and has more chances to switch to a different thread that is ready to process and waiting for it’s chance.

TimerResolution

Also, you know those settings in Control Panel that can give priority to foreground or background processes? They allocate time based on a undefined unit called a quanta, the reason that this is unit is undefined is that it depends… on the system timer resolution.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s