Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local c = peripheral.wrap "back".canvas()
- local w,h = c.getSize()
- local out = c.addText({9, h - 16}, "NO TPS")
- while true do
- local game_time_start = os.epoch "utc"
- sleep(1)
- local game_time_end = os.epoch "utc"
- local utc_elapsed_seconds = (game_time_end - game_time_start) / 1000
- _G.tps = 20 / utc_elapsed_seconds
- out.setText(string.format("TPS: %.2f", tps))
- local c
- if tps > 19 then c = 0x00FF00FF
- elseif tps > 15 then c = 0xFFFF00FF
- elseif tps > 10 then c = 0xFF8800FF
- else c = 0xFF0000FF end
- out.setColor(c)
- sleep(1)
- end
Add Comment
Please, Sign In to add comment