Set Windows Timer Resolution
Home | Timer Resolution | Facebook
TimerResolution is an application to change the resolution of the default windows timer. The standard timer on Windows XP can vary between 10 and 25 milliseconds. Therefore if your code uses a timer or sleep value less than the timer resolution on your system you won't be getting the results you expect.

The timer resolution will be globally changed while the application is running and will revert to the previous value when it is closed.

1ms timers are achievable using this application.

[Download] TimerResolution.zip (7Kb) Version 1.2

You are free to use this application for personal use. Commercial use requires a minimum AUD$5 donation.
 

Update 2007-10-07
TimerResolution Version 2.0 is now available but is no longer free.
The new features are:
- Command line to hide on startup
- Command line to set the timer to the maximum resolution (shortest period) on startup

If you like to request a copy of this new version please email me at lucashale@gmail.com
Version 1 will continue to be available free from this site. 


Update 2007-10-05
TimerResolution Version 1.2 has now passed basic testing on Windows Vista. Vista appears to have better timers than XP so further investigation is required.

How did this application get created?

I had a need for a program to run every 5 milliseconds but I found that no matter what I did the best I could get was 12ms. I tried different values for my timer and found that a value above 12ms would also produce results with jitter up to 12ms. What was so special about 12ms? I tried a different computer and found that the magic value was 15ms... what was windows doing? Time to Google the answer.

I left the program running to see if the value changed with time or CPU load. Suddenly the program started to produce 5ms results with very little jitter! By trial and error I found that if I loaded a particular web page the program worked as expected. What was so special about this page? It turns out that it had a Flash based advertisement on it so I had my next clue. As a guess I closed the web page and started Media Player and got the same result. It seems that when an application requests a high resolution timer for multimedia purposes it changes the resolution of the timer for the entire system.

So now I had a solution but it required linking to the winmm.lib which as a programmer didn't sit well with me since my application had nothing to do with multimedia. A little more research and I was onto the undocumented native API. Now I had the lightweight solution I was looking for. I hope you find that the program answers some questions for you. I've found that it can improve the performance and responsiveness of all sorts of applications.

Questions or feedback can be emailed to lucashale@gmail.com

Note: This page was located at http://users.tpg.com.au/lucash/ until October 2007 when it moved to its new home here.

Useful Links on the Windows Timers
Sysinternals Freeware - Inside Windows NT High Resolution Timers
MSDN - Windows Multimedia SDK Obtaining and Setting Timer Resolution
The Code Project - Timers tutorial - System 

Please help to keep this software free

[Download] TimerResolution.zip (7Kb) Version 1.2
 

Copyright © 2007 Lucas Hale

Google