interval

fun interval(scope: CoroutineScope, period: Duration, block: suspend () -> Unit): KInterval(source)

Creates a KInterval that fires block every period.

val clock = interval(viewModelScope, 1.seconds) { tick() }
clock.clear() // stop