Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
How do i display fps - Gideros Forum

How do i display fps

hnimhnim Member
edited February 2012 in General questions
Hi, i want to test performance of my game. How do i display fps on game screen or print log?
thanks :)


  • yes, is there any way to calculate this value?
  • GregBUGGregBUG Guru
    edited February 2012
    on onEnterFrame(event)
    function onEnterFrame(event)
        local fps = 1/event.deltaTime  
    TNT ENGiNE for Gideors Studio - Particle Engine, Virtual Pad, Animator Studio, Collision Engine - DOWNLOAD NOW !!! IT'S FREE!!! -
  • If you're using an iPhone, and run the GiderosiPhonePlayer from Xcode with the iPhone plugged in, it shows fps on the debug console.

    I don't know if there's the same facility with Android.
  • Thanks GregBUG :)
    If i build and run project from eclipse, i can see fps in logcat
  • atilimatilim Maintainer
    edited February 2012

    The fps seen in Xcode console and logcat uses a algorithm like:
    local frame = 0
    local timer = os.timer()
    local function displayFps()
    	frame = frame + 1
    	if frame == 60 then
    		local currentTimer = os.timer()
    		print(60 / (currentTimer - timer))
    		frame = 0
    		timer = currentTimer	
    stage:addEventListener(Event.ENTER_FRAME, displayFps)
    (It's same with @GregBUG's but averaged through 60 frames)
  • hnimhnim Member
    edited February 2012
Sign In or Register to comment.