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.
Notice any errors or typos? Please let us know. Please feel free to edit src/core/environment.js and open a pull request!