In the default main.lua script there is some code that shows stats and FPS.
--Render statistics
context:SetBlendMode(Blend.Alpha)
if DEBUG then
context:SetColor(1,0,0,1)
context:DrawText("Debug Mode",2,2)
context:SetColor(1,1,1,1)
context:DrawStats(2,22)
context:SetBlendMode(Blend.Solid)
else
--Toggle statistics on and off
if (window:KeyHit(Key.F11)) then showstats = not showstats end
if showstats then
context:SetColor(1,1,1,1)
context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2)
end
end
I usually use a third-party tool like FRAPS because it ensures consistency across all programs.