kotlin.concurrent.java.util.Timer

Extensions for java.util.Timer

schedule

fun Timer.schedule(
    delay: Long, 
    action: TimerTask.() -> Unit
): TimerTask

Schedules an action to be executed after the specified delay (expressed in milliseconds).

fun Timer.schedule(
    time: Date, 
    action: TimerTask.() -> Unit
): TimerTask

Schedules an action to be executed at the specified time.

fun Timer.schedule(
    delay: Long, 
    period: Long, 
    action: TimerTask.() -> Unit
): TimerTask

Schedules an action to be executed periodically, starting after the specified delay (expressed in milliseconds) and with the interval of period milliseconds between the end of the previous task and the start of the next one.

fun Timer.schedule(
    time: Date, 
    period: Long, 
    action: TimerTask.() -> Unit
): TimerTask

Schedules an action to be executed periodically, starting at the specified time and with the interval of period milliseconds between the end of the previous task and the start of the next one.

scheduleAtFixedRate

fun Timer.scheduleAtFixedRate(
    delay: Long, 
    period: Long, 
    action: TimerTask.() -> Unit
): TimerTask

Schedules an action to be executed periodically, starting after the specified delay (expressed in milliseconds) and with the interval of period milliseconds between the start of the previous task and the start of the next one.

fun Timer.scheduleAtFixedRate(
    time: Date, 
    period: Long, 
    action: TimerTask.() -> Unit
): TimerTask

Schedules an action to be executed periodically, starting at the specified time and with the interval of period milliseconds between the start of the previous task and the start of the next one.

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

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部