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?