ScriptCost
how often one script ran and how long each call took
Fields
4 members
Finding the Scripts That Cost the Most
Lifecycle: Shared
The average covers one call in seconds, so multiplying it by the call count gives the time the script spent in total.
Luau
local budget = 0.005for _, cost in ipairs(game.Profiler.Scripts()) do local total = cost.avg * cost.calls if total > budget then print(string.format("%s: %.2f ms over %d calls", cost.path, total * 1000, cost.calls)) endend