runRepeating

abstract fun runRepeating(period: Long = 1, delay: Long = 1, block: (TaskContext) -> Unit)

Runs a task indefinitely at later points in time until the task is cancelled.

Parameters

period

The interval between each task invocation, in ticks.

delay

How long until the first task runs, in ticks.

block

The task to run, which can also modify the TaskContext.