p5.js | frameRate() Function
The frameRate() function in p5.js is used to specify the number of frames to be displayed every second. Calling frameRate() with no arguments returns the current framerate. The draw function must run at least once before it will return a value. This function is same as getFrameRate() function.
frameRate( c )
Parameters: The function accepts single parameter c which stores the value of frame rate variable.
Below program illustrates the frameRate() function in p5.js: