tock / ai.tock.shared / Executor / setPeriodic

# setPeriodic

`open fun setPeriodic(delay: Duration, runnable: () -> Unit): Long` (source)

Execute a periodic task.

### Parameters

`delay` - the delay between each other call

`runnable` - the task to run

`abstract fun setPeriodic(initialDelay: Duration, delay: Duration, runnable: () -> Unit): Long` (source)

Execute a periodic task.

### Parameters

`initialDelay` - the delay before first call

`delay` - the delay between each other call

`runnable` - the task to run