ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. getGamePerformance

Function

getGamePerformance

ClientUtilitiesTrilogy Hub only

Returns the game's performance for this player since the previous read (a window of at least 250 ms): FPS, average and longest frame time, script time per frame, the game's CPU and memory use, and ping. Which resource costs the most is shown by getResourceUsage.

Syntax

table getGamePerformance()

Returns

{ fps, frameMs, frameMaxMs, luaMs, luaMaxMs, cpu, cores, ramMB, privateMB, luaKB, ping } (cpu = % of the whole CPU), or false.

Example

addCommandHandler("fps", function()
    local p = getGamePerformance()
    if p then outputChatBox(("FPS %d, klatka %.1f ms, RAM %d MB"):format(p.fps, p.frameMs, p.ramMB)) end
end)

See also