Functions

cpu() report the current CPU time
event(e) resume all coroutines waiting on this event name
go(w, func, ...) schedule a function
now() report the current script scheduler time
scheduler() create a new independent scheduler (not connected to the real-time clock)
wait(w) yield the containing coroutine to the scheduler

Functions

cpu()

report the current CPU time

event(e)

resume all coroutines waiting on this event name

Parameters:

e event name (string)
go(w, func, ...)

schedule a function

Parameters:

w (optional) duration (seconds) or event name (string) to wait for before starting coroutine
func function to form the body of the coroutine
... args passed to the coroutine
now()

report the current script scheduler time

Return:

  • time in seconds since script began
scheduler()

create a new independent scheduler (not connected to the real-time clock)

Return:

  • scheduler scheduler object
wait(w)

can be run in the main (top-level) script, but not safe within callbacks (such as Window:draw())

Parameters:

w duration (seconds) or event name (string)