public class Timer:
Event-loop based GUI timer.
Timer is intended for GUI refreshes and lightweight periodic actions. Its timeout event is emitted by the native window event loop, so callbacks can safely update widgets and request repaints.
@example `klyn timer = Timer(1000) timer.timeout += lambda(event: ActionEvent): print("tick") timer.start()
| Modifier and Type | Member | Description |
|---|---|---|
| public property | intervalinterval as Int: |
Timer period in milliseconds. |
| public readonly property | isRunningisRunning as Boolean: |
Indicates whether the timer is currently active. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Timer | Creates a timer with an interval expressed in milliseconds. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | startstart() as Void: |
Starts the timer using the current interval. |
| public | startstart(interval as Int) as Void: |
Starts the timer using a new interval. |
| public | stopstop() as Void: |
Stops the timer. |
| public | ticktick() as Void: |
Emits the timeout event when called by the native event loop. |