public abstract class Timer extends Object
The run() method may be invoked on a thread other than the UI thread. If a developer wants to process timer events on the UI thread, they can use the Application.invokeLater/invokeAndWait() API.
Modifier | Constructor and Description |
---|---|
protected |
Timer(Runnable runnable)
Constructs a new timer.
|
Modifier and Type | Method and Description |
---|---|
protected abstract long |
_start(Runnable runnable) |
protected abstract long |
_start(Runnable runnable,
int period) |
protected abstract void |
_stop(long timer) |
static int |
getMaxPeriod()
Returns the maximum timer period supported by the native system.
|
static int |
getMinPeriod()
Returns the minimum timer period supported by the native system.
|
boolean |
isRunning()
Returns true if the timer is currently running
(convenience API: might not need it)
|
void |
start()
Start a vsync-based timer if the system supports it.
|
void |
start(int period)
Starts the timer.
|
void |
stop()
Stops the timer.
|
protected Timer(Runnable runnable)
protected abstract long _start(Runnable runnable)
protected abstract long _start(Runnable runnable, int period)
protected abstract void _stop(long timer)
public static int getMinPeriod()
public static int getMaxPeriod()
public void start(int period)
public void start()
public void stop()
public boolean isRunning()
Copyright © 2020. All rights reserved.