TikTok for Developers

开发者文档

上次更新时间:2026年10月2日

Frame Rate

Allows you to control the rendering frame rate of your mini game. Adjusting the frame rate affects how often requestAnimationFrame callbacks are triggered, which can help balance visual smoothness against performance and battery consumption.

TTMinis.game.setPreferredFramesPerSecond(fps)

Sets the preferred rendering frame rate. The default is 60 frames per second. After modification, the callback frequency of requestAnimationFrame changes accordingly.

Parameters

Field

Type

Description

Required

fps

int32

The frame rate. Valid range: 1 to 60.

Yes

Example

TTMinis.game.setPreferredFramesPerSecond(30);
TikTok for Developers