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...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Gabor Szauer on the 4th of Jul 2009 05:43:14 AM Download | Raw | Embed | Report
  1. // Author: Gabor Szauer
  2. //         http://gaborszauer.com
  3. // Last Updated: July 3, 2009
  4. // Changelog:
  5.  
  6. //////////////////////////////////////////////////////
  7. /* Decloration */
  8. unsigned int nFPS;
  9. unsigned int nSleep;
  10. unsigned int nSkipTick;
  11. unsigned DWORD dwNextTick;
  12. //////////////////////////////////////////////////////
  13.  
  14. //////////////////////////////////////////////////////
  15. /* Initialization */
  16. nFPS = FPS;
  17. nSkipTick = 1000 / nFPS;
  18. nSleep = 0;
  19. dwNextTick = GetTickCount();
  20. //////////////////////////////////////////////////////
  21.  
  22. //////////////////////////////////////////////////////
  23. /* Dellay Code */
  24. dwNextTick += nSkipTick;
  25. nSleep = dwNextTick - GetTickCount();
  26. if (nSleep >= 0) {
  27.         Sleep(nSleep);
  28. }
  29. //////////////////////////////////////////////////////
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: