Recent Posts
None | 4 sec ago
C | 9 sec ago
Lua | 18 sec ago
C | 24 sec ago
PHP | 29 sec ago
None | 30 sec ago
Lua | 31 sec ago
None | 49 sec ago
Lua | 53 sec ago
C++ | 55 sec ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Gabor Szauer on the 4th of Jul 2009 05:43:14 AM
Download |
Raw |
Embed |
Report
// Author: Gabor Szauer
// http://gaborszauer.com
// Last Updated: July 3, 2009
// Changelog:
//////////////////////////////////////////////////////
/* Decloration */
unsigned int nFPS;
unsigned int nSleep;
unsigned int nSkipTick;
unsigned DWORD dwNextTick;
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
/* Initialization */
nFPS = FPS;
nSkipTick = 1000 / nFPS;
nSleep = 0;
dwNextTick = GetTickCount();
//////////////////////////////////////////////////////
//////////////////////////////////////////////////////
/* Dellay Code */
dwNextTick += nSkipTick;
nSleep = dwNextTick - GetTickCount();
if (nSleep >= 0) {
Sleep(nSleep);
}
//////////////////////////////////////////////////////
Submit a correction or amendment below.
Make A New Post