Skip to main content

cycle

Description:

  A function that keeps another function to run repeatedly for a duration of time.

Signature:

cycle: function(duration: number, work: function(time: number))

Parameters:

ParameterTypeDescription
durationnumberThe duration of the cycle, in seconds.
workfunctionA function to execute repeatedly during the cycle. receiving a time value from 0 to 1 to indicate the execution progress.