Heartbeat

constructor(startDelay: Duration = Duration.ZERO, period: Duration, coroutineContext: CoroutineContext, task: () -> Unit)

Parameters

startDelay

The initial delay before the first execution of the task.

period

The time interval between consecutive executions of the task.

coroutineContext

The coroutine context in which the heartbeat will run.

task

The function to be executed periodically.