Name

frameRate()

Examples
pos = 0

def setup():
    frameRate(4)

def draw():
    background(204)
    global pos
    pos += 1
    line(pos, 20, pos, 80)
    if pos > width:
        pos = 0
Description Specifies the number of frames to be displayed every second. For example, the function call frameRate(30) will attempt to refresh 30 times a second. If the processor is not fast enough to maintain the specified rate, the frame rate will not be achieved. Setting the frame rate within setup() is recommended. The default rate is 60 frames per second.
Syntax
frameRate(fps)
Parameters
fpsfloat: number of desired frames per second
Related frameRate
frameCount
setup()
draw()
loop()
noLoop()
redraw()

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.