All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.web.timers.interval.kt Maven / Gradle / Ivy

package web.timers

import kotlin.time.Duration
import kotlin.time.DurationUnit.MILLISECONDS

external fun setInterval(
    callback: () -> Unit,
    ms: Int = definedExternally,
): Timeout

external fun clearInterval(
    intervalId: Timeout,
)

// extensions

fun setInterval(
    delay: Duration,
    callback: () -> Unit,
): Timeout =
    setInterval(
        callback,
        delay.toInt(MILLISECONDS)
    )




© 2015 - 2025 Weber Informatics LLC | Privacy Policy