App seems to be running at 30 fps no matter what?

I put up a counter on enterFrame and removed the enterFrame listener when the counter reaches 60.  It takes about two seconds for the counter to reach 60.   Then I found this code that displays fps on the screen.  I’m always stuck on 30 fps

function showFps() local prevTime = 0 local curTime = 0 local dt = 0 local fps = 50 local mem = 0 local underlay = display.newRoundedRect(0, 0, 300, 20, 12) underlay.x = 240 underlay.y = 11 underlay:setFillColor(0, 0, 0, 128) local displayInfo = display.newText("FPS: " .. fps .. " - Memory: ".. mem .. "mb", 120, 2, native.systemFontBold, 16) local function updateText() curTime = system.getTimer() dt = curTime - prevTime prevTime = curTime fps = math.floor(1000 / dt) mem = system.getInfo("textureMemoryUsed") / 1000000 --Limit fps range to avoid the "fake" reports if fps \> 60 then fps = 60 end displayInfo.text = "FPS: " .. fps .. " - Memory: ".. string.sub(mem, 1, string.len(mem) - 4) .. "mb" underlay:toFront() displayInfo:toFront() end Runtime:addEventListener("enterFrame", updateText) end 

under my config.lua i have fps set to 60 under the content section.  what is up with this. why isnt my app running at 60 fps?

Setting fps to 60 in config.lua just means that 60 is the fastest it will ever go. As your app has more and more content to process it will start to slow down. 

I’m not sure how big your project is, but you may need to look into optimising what you have so far in order to bring the frame rate up.

Also depending on exactly what you are trying to do, counting to 60 in an enterFrame listener and hoping that you have exactly 60fps is a big gamble. Some devices are slower than others, so while some devices may get 60fps, other’s might only manage 20fps so it would take 3s to finish the count.

A better bet would be to either just use a timer.performWithDelay call (with a 1000ms delay) or track the time between frames and use that to count towards 1s.

Setting fps to 60 in config.lua just means that 60 is the fastest it will ever go. As your app has more and more content to process it will start to slow down. 

I’m not sure how big your project is, but you may need to look into optimising what you have so far in order to bring the frame rate up.

Also depending on exactly what you are trying to do, counting to 60 in an enterFrame listener and hoping that you have exactly 60fps is a big gamble. Some devices are slower than others, so while some devices may get 60fps, other’s might only manage 20fps so it would take 3s to finish the count.

A better bet would be to either just use a timer.performWithDelay call (with a 1000ms delay) or track the time between frames and use that to count towards 1s.