setInterval
fun WindowOrWorkerGlobalScope.setInterval(delay: Duration, block: () -> Unit): CancellableActionHandle(source)
A more Kotlin-friendly version of window.setInterval
(with a Duration& the lambda parameter last).
Return
A CancellableActionHandle to the action being invoked. Use CancellableActionHandle.cancel to cancel the action.
fun WindowOrWorkerGlobalScope.setInterval(initialDelay: Duration, delay: Duration, block: () -> Unit): CancellableActionHandle(source)
A version of setInterval where the initial delay is different from the followup delay.
This can be useful if you need to fire something immediately but then have a different delay for subsequent invocations.
Return
A CancellableActionHandle to the action being invoked. Use CancellableActionHandle.cancel to cancel the action.