💻
Sets the target frame rate or gets an approximation of the
sketch's current frame rate.
Even when the sketch is running at a consistent frame rate,
the current frame rate value will fluctuate. Use your web browser's
developer tools for more accurate performance analysis.
Parameters
Optionalhertz: number
target frame rate, default is 60
Returns number
current frame rate
Example
q5.draw = function () { background(0.8);
if (mouseIsPressed) frameRate(10); elseframeRate(60);
💻 Sets the target frame rate or gets an approximation of the sketch's current frame rate.
Even when the sketch is running at a consistent frame rate, the current frame rate value will fluctuate. Use your web browser's developer tools for more accurate performance analysis.