Scratch Modules Gallery

FPS

Calculate FPS.

performancefps

Contributors: LuYifei2011

Scripts

Main

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
FPSVariableGlobal
DELTAVariableGlobal
tick30VariableSprite

References