Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help with some Frames Per Second display?

I cannot find the Frames Per Second option for ROBLOX Studio?

This code does not really work for me.

print(game.Workspace:GetRealPhysicsFPS()

1 answer

✓ Accepted answer

You could always make your own using the Heartbeat event from RunService:

local FPS = 0

game:GetService("Run Service").Heartbeat:connect(function(step)
	FPS = 1/step
end)

This primitive example is very poor however, as it bases the number of frames per second on how long it took to render a single frame. A better way would be to count the number a frames that are made every second:

local FPS = 0
local frames = 0
local elapsed = 0

game:GetService("Run Service").Heartbeat:connect(function(step)
	frames = frames + 1
	elapsed = elapsed + step
	if elapsed >= 1 then
		FPS = frames/elapsed
		frames = 0
		elapsed = 0
	end
end)

There are many other algorithms out there as well that you may like better than these simple approaches.

1 comment

0

Or did you mean when editing a place in Roblox studio?

This discussion is preserved as it was. New answers, comments, and votes are closed.