Script Performance Evaluator or SPE
Key RequiredUniversal

Script Performance Evaluator or SPE

Universal ScriptUnnesscaryInventionsUnnesscaryInventions 68.8K views 757 executesUpdated Jul 27, 2024
Unrated
00
Lua Script•35 lines (882 chars)
local function measureExecutionTime(codeBlock)
    local startTime = os.clock()
    codeBlock()
    local endTime = os.clock()
    local elapsedTime = endTime - startTime
    return elapsedTime
end

local function classifyPerformance(time)
    if time < 0.1 then
        return "Perfect"
    elseif time < 0.25 then
      return "Excellent"
    elseif time < 0.5 then
        return "Great"
    elseif time < 0.75 then
        return "Considerable"
    elseif time < 1 then
        return "Average"
    elseif time < 2 then
        return "Poor"
    else
        return "Bad"
    end
end

local time = measureExecutionTime(function()
    -- // Example code. Replace with your own code
    local sum = 0
    for i = 1, 1000000 do
        sum = sum + i
    end
    print(sum)
end)
print(string.format("Execution time: %.6f seconds - Performance: %s", time, classifyPerformance(time)))

Features & Information

Evaluate script performance by tracking how long it takes to execute! NOTE = { This is a rushed script! }

Community Comments (5)

UnnesscaryInventionsUnnesscaryInventionsJul 27, 2024(edited)

it's gotta be another monstrosity :sob: - h.ry1

GrayGrayJul 27, 2024(edited)

Lmaoo ur doom when u realize os.clock() doesn't support by roblox that's why tick() invented

UnnesscaryInventionsUnnesscaryInventionsJul 27, 2024(edited)

Just tested it. It works

UnnesscaryInventionsUnnesscaryInventionsJul 27, 2024(edited)

@Gray

mxsynrymxsynrySep 13, 2024(edited)

@UnnesscaryInventions you know it

More Scripts for Universal Scripts