Jump to content

The Hankinator's Ticker of FPS


thehankinator
 Share

Recommended Posts

I made this FPS simple ticker script to get a better idea of how long and often the frame rate drops. It's pretty rudimentary but works. Just call FPSTicker(). Red line = 0FPS, Yellow line = 30FPS. Horizontal lines are every 60 frames.

 

http://steamcommunity.com/sharedfiles/filedetails/?id=583506145

 

EDIT: Good god why does the forum always butcher code formatting?

 

#The Hankinator's Ticker of FPS
function FPSTicker()
if ticker_fps_data == nil then
ticker_fps_data = {}
end
context:SetBlendMode(Blend.Alpha)
--vertical bars
context:SetColor(0.25,0.25,0.25,1)
for i=1,5 do
context:DrawLine(60 * i, 0, 60 * i, 60)

end
--horizontal bars
context:SetColor(1,1,0,1)
context:DrawLine(0, 30, 300, 30)--30fps
context:SetColor(1,0,0,1)
context:DrawLine(0, 60, 300, 60)--0fps
--performance data
context:SetColor(1,1,1,1)
table.insert(ticker_fps_data, Time:UPS())
for i = 2, #ticker_fps_data do
context:DrawLine(i-1, 60-ticker_fps_data[i-1], i, 60-ticker_fps_data[i])
end
if #ticker_fps_data > 300 then
table.remove(ticker_fps_data, 1)
end
end

 

viCLDAE.png

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...