public final class ZTimer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ZTimer.Timer
Opaque representation of a timer.
|
| Constructor and Description |
|---|
ZTimer() |
| Modifier and Type | Method and Description |
|---|---|
ZTimer.Timer |
add(long interval,
TimerHandler handler,
Object... args)
Add timer to the set, timer repeats forever, or until cancel is called.
|
int |
execute()
Execute the timers.
|
int |
sleepAndExecute()
Sleeps until at least one timer can be executed and execute the timers.
|
long |
timeout()
Returns the time in millisecond until the next timer.
|
public ZTimer.Timer add(long interval, TimerHandler handler, Object... args)
interval - the interval of repetition in milliseconds.handler - the callback called at the expiration of the timer.args - the optional arguments for the handler.public long timeout()
public int execute()
public int sleepAndExecute()
Copyright © 2020. All rights reserved.