UI Refreshment Rate?

I was wondering if anyone knew how many times the Codea runs through a program every second? In other words if I set a value to 0 and added 1 to it every time codea re-executed my program, what would the value be after a second?

use ElapsedTime or DeltaTime
print(ElapsedTime, DeltaTime)

dind’t understand your question. start a timer and a counter. increment the counter every frame (draw()) until the timer reaches 1 sec.

Codea tries to run at 60 frames per second, and will run at that speed as long as there’s not too much processor intensive tasks to do. To view the frames per second, do-

parameter.watch("1/DeltaTime")

@bhob12 - the easy way to see the answer is just to write a little program that prints the counter value every second…

Thank you everyone for your assistance. :slight_smile:

@bhob12 This calculates the frame rate.

-- putt in main outside of setup
FPS = 60
local elapsedTime, memory = 0, 0

    -- putt in draw
    pushMatrix()
    resetMatrix()
    pushStyle()
    fontSize(10)
    fill(255, 255, 255, 255)
    FPS = FPS * 0.9 + 0.1 / DeltaTime
    text(string.format("%.0fFPS %.1fMB", FPS, memory), WIDTH - 50, 10)
    popStyle()
    popMatrix()   

perhaps a little simpler, especially for small programs

--in setup
parameter.integer("FPS",0,60,60)

--in draw
FPS = FPS * 0.9 + 0.1 / DeltaTime