tencent cloud

Frame Rate
Last updated: 2025-04-10 18:18:34
Frame Rate
Last updated: 2025-04-10 18:18:34

wx.setPreferredFramesPerSecond

This API is called using wx.setPreferredFramesPerSecond(number fps).
Feature description:Modifies the rendering frame rate. The default rendering frame rate is 60 frames per second. Changing this will affect the frequency of requestAnimationFrame callbacks.
Parameter and description: number fps. Frame rate. Value range: 1-60.

cancelAnimationFrame

This API is called using cancelAnimationFrame(number requestID).
Feature description: Cancels an animation frame request previously scheduled with requestAnimationFrame.
Parameter and descriptionnumber requestID.

requestAnimationFrame

This API is called using the number requestAnimationFrame(function callback).
Feature description: Schedules a callback to be executed before the next repaint.
Parameter and descriptionfunction callback. The function to be executed.
Return value: Request ID.

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback