Scratch Modules Gallery

FPS

计算FPS。

性能 fps

Contributors: LuYifei2011

Scripts

主脚本

when flag clicked
set [DELTA v] to (1)
set [tick30 v] to (0)
forever
  FPS (tick30) :: custom
end

define FPS (last tick30 :: custom-arg)
set [tick30 v] to ((timer) * (30))
set [DELTA v] to ((tick30) - (last tick30 :: custom-arg))
set [FPS v] to (round ((30) / (DELTA)))

Variables / Lists

NameTypeScope
帧率VariableGlobal
时间差VariableGlobal
tick30VariableSprite

References