Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. double current_time = 0;
  2. double last_time = 0;
  3. int n = 0;
  4. int fps = 60;
  5. u64 tick;
  6.  
  7.  
  8. int XT_getFPS(lua_State *L)
  9. {
  10. n++;
  11. sceRtcGetCurrentTick(&tick);
  12.  
  13. current_time = tick/1000;
  14.  
  15. if ((current_time - last_time) >= 1000)
  16. {
  17. fps = n;
  18. n = 0;
  19. last_time = current_time;
  20. }
  21.  
  22. lua_pushnumber(L, fps);
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement