Reference frameRate()

frameRate()

Sets the number of frames to draw per second.

Calling frameRate() with one numeric argument, as in frameRate(30), attempts to draw 30 frames per second (FPS). The target frame rate may not be achieved depending on the sketch's processing needs. Most computers default to a frame rate of 60 FPS. Frame rates of 24 FPS and above are fast enough for smooth animations.

Calling frameRate() without an argument returns the current frame rate. The value returned is an approximation.

Examples

Syntax

frameRate(fps)
frameRate()

Parameters

fps
Number:

number of frames to draw per second.

This page is generated from the comments in src/core/environment.js . Please feel free to edit it and submit a pull request!

Related References