GlokTimer
class GlokTimer(val delay: Double, val repeating: Boolean = false, val action: () -> Unit) : Comparable<GlokTimer>
Runs code after a given time interval. This is not a high precision timer, there is no guarantee about how soon after delay milliseconds, the action will be performed.
The timer is not started on creation. You must call start.
delay is measured in milliseconds, and stored as a Double for compatibility with javascript, which doesn't support the Long
type.
If repeating == false
, action is performed only once, and then the timer stops. Otherwise, action will be repeated every delay milliseconds until the timer is stopped.