#_purplefish's fps calculator

1 messages · Page 1 of 1 (latest)

candid sail
#
local RunService = game:GetService("RunService")
local maxFps = 60

local function calculateFPS()
    local t = 0
    local count = 0
    local fps = 0

    while true do
        local deltaTimeSim = RunService.PostSimulation:Wait()
        t += deltaTimeSim
        count += 1
         if t >= 1 then
            connection:Disconnect()
            connection = nil
            
            fps  = ((1/t) - (1 - (count/maxFps))) * maxFps
        end
    end

    return fps
end

local fps_one_second_ago = calculateFPS()
print("FPS : "..fps_one_second_ago)

note : it take one second to calculate fps and
the fps calculated will contain decimal points

I was attempting to replicate how Roblox calculate your fps

pale citrus
#

why wrap in while loop 💀

candid sail
#

idk

#

come no more loop now

pale citrus
#

did you forget to return?

candid sail
#

great

#

i lazy to fix that

#

i try

#

i fixed that

#

this is what happen when you calculate it manually

pale citrus
#

60/1 real

limber bridge
#

How is this better than just counting renderstepped events…

candid sail
#

if you press shift + f5

#

you will see fps