public interface Timer
| Modifier and Type | Method and Description |
|---|---|
void |
add(TimerTask timerTask)
添加新的任务到当前执行器(线程池),在任务过期后会执行任务。
|
boolean |
advanceClock(long timeoutMs)
推进内部时钟,执行任何在走过的时间间隔内过期的任务
|
static Long |
getHiresClockMs() |
void |
shutdown()
关闭定时器服务,待执行的任务将不会被执行
|
long |
size()
取得待执行的任务数量
|
void add(TimerTask timerTask)
timerTask - the task to addboolean advanceClock(long timeoutMs)
timeoutMs - timeoutMslong size()
void shutdown()
static Long getHiresClockMs()
Copyright © 2025. All rights reserved.