Guest User

Untitled

a guest
Oct 17th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // --- simple FPS vars and function
  2. int FPScounter = 0;
  3. float FPSfLastTickCount = 0.0f;
  4. float FPSfCurrentTickCount;
  5.  
  6. void FPScheck(char *str, char *format)
  7. {
  8. FPSfCurrentTickCount = (clock() * 0.001f);
  9. FPScounter++;
  10.  
  11. if((FPSfCurrentTickCount - FPSfLastTickCount) > 1.0f) {
  12. FPSfLastTickCount = FPSfCurrentTickCount;
  13. sprintf(str,format,FPScounter);
  14. FPScounter = 0;
  15. }
  16. }
Add Comment
Please, Sign In to add comment