Run the game smoother
by demasoni · in Torque Game Builder · 01/06/2009 (3:55 am) · 1 replies
First of all, I would like to suggest you to run this program. Suddenly, you will see that programs run smoother and faster on your computer!
Analysis
The application calls Sleep(1) in every cycle. It tries to give out some free time to the high level applications which caused the issue. Sleep(1) usually does not sleep for just 1ms, but for 10-15ms depending on your system. This is the frequency of your clock interrupts, and it is also your minimum timer resolution. But some multimedia applications do need a higher resolution timer which is as accurate as your hardware can be. Microsoft provides this functionality in the Multimedia SDK. You can call the API timeBeginPeriod(1) to adjust the minimum timer resolution to be 1ms. However, it impacts the whole system as all applications would call Sleep(1) which actually sleeps 1ms. The Yahoo! Finance page contains a Macromedia Flash control that happens to call the timeBeginPeriod() and this application can do it.
This program require Microsoft .NET Framework2 to run (maybe already installed, see add or remove programs) and don’t work in all computer and operating system.
Speed Up.exe
Analysis
The application calls Sleep(1) in every cycle. It tries to give out some free time to the high level applications which caused the issue. Sleep(1) usually does not sleep for just 1ms, but for 10-15ms depending on your system. This is the frequency of your clock interrupts, and it is also your minimum timer resolution. But some multimedia applications do need a higher resolution timer which is as accurate as your hardware can be. Microsoft provides this functionality in the Multimedia SDK. You can call the API timeBeginPeriod(1) to adjust the minimum timer resolution to be 1ms. However, it impacts the whole system as all applications would call Sleep(1) which actually sleeps 1ms. The Yahoo! Finance page contains a Macromedia Flash control that happens to call the timeBeginPeriod() and this application can do it.
This program require Microsoft .NET Framework2 to run (maybe already installed, see add or remove programs) and don’t work in all computer and operating system.
Speed Up.exe
About the author
Associate amaranthia
The API timeBeginPeriod adjusts the granularity of the timer given to the calling process... the documentation can be found here:
http://msdn.microsoft.com/en-us/library/ms713413.aspx
An application with timer usage should leverage their understanding of their product to adjust this granularity as appropriate.
Clearly, reducing the granularity (read: providing a larger timer value to timeBeginPeriod) will assist in your performance goals.
Calling "Sleep" in every cycle simply suspends the activity of the calling process by the provided duration (thus yielding to other processes... which may help to explain your findings)... the documentation supporting this can be found here:
http://msdn.microsoft.com/en-us/library/ms686298.aspx
Lastly, it would appear you've posted twice... you may want to revisit the forum and remove one of these entries.