kotlin.concurrent.timer

timer

inline fun timer(
    name: String? = null, 
    daemon: Boolean = false, 
    initialDelay: Long = 0.toLong(), 
    period: Long, 
    crossinline action: TimerTask.() -> Unit
): Timer

Platform and version requirements: JVM

Creates a timer that executes the specified action periodically, starting after the specified initialDelay (expressed in milliseconds) and with the interval of period milliseconds between the end of the previous task and the start of the next one.

Parameters

name - the name to use for the thread which is running the timer.

daemon - if true, the thread is started as a daemon thread (the VM will exit when only daemon threads are running).

inline fun timer(
    name: String? = null, 
    daemon: Boolean = false, 
    startAt: Date, 
    period: Long, 
    crossinline action: TimerTask.() -> Unit
): Timer

Platform and version requirements: JVM

Creates a timer that executes the specified action periodically, starting at the specified startAt date and with the interval of period milliseconds between the end of the previous task and the start of the next one.

Parameters

name - the name to use for the thread which is running the timer.

daemon - if true, the thread is started as a daemon thread (the VM will exit when only daemon threads are running).

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.concurrent/timer.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部