Advertisement
Alyssa

TPS Monitor

Jan 5th, 2020
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. function getTicksFromSeconds(seconds)
  2.     return seconds / 3600
  3. end
  4.  
  5. ingameTimeA = os.epoch("ingame")
  6. realTimeA = os.epoch("utc")
  7. sleep(1)
  8. ingameTimeB = os.epoch("ingame")
  9. realTimeB = os.epoch("utc")
  10.  
  11. ingameDeltaTime = ingameTimeB - ingameTimeA
  12. ticksElapsed = getTicksFromSeconds(ingameDeltaTime)
  13. realDeltaTime = (realTimeB - realTimeA) / 1000
  14.  
  15. ticksPerSecond = ticksElapsed / realDeltaTime
  16. print("The server TPS is " .. tostring(ticksPerSecond))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement