Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local FpsLabel = script.Parent
- local Heartbeat = game:GetService("RunService").Heartbeat
- local LastIteration, Start
- local FrameUpdateTable = { }
- local function HeartbeatUpdate()
- LastIteration = tick()
- for Index = #FrameUpdateTable, 1, -1 do
- FrameUpdateTable[Index + 1] = (FrameUpdateTable[Index] >= LastIteration - 1) and FrameUpdateTable[Index] or nil
- end
- FrameUpdateTable[1] = LastIteration
- local CurrentFPS = (tick() - Start >= 1 and #FrameUpdateTable) or (#FrameUpdateTable / (tick() - Start))
- CurrentFPS = math.floor(CurrentFPS)
- FpsLabel.Text = CurrentFPS .. " FPS"
- end
- Start = tick()
- wait(1)
- Heartbeat:Connect(HeartbeatUpdate)
- --code made by randomStuffz
- --modified by kurt faircloth/kurtfan5468
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement