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