package timers
Non-Standard Non-standard, but in general well supported methods to schedule asynchronous execution.
The methods in this package work in all JavaScript virtual machines
supporting setTimeout
and setInterval
.
- Alphabetic
- By Inheritance
- timers
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
sealed
trait
SetIntervalHandle extends Any
Non-Standard A handle returned from a call to setInterval.
Non-Standard A handle returned from a call to setInterval.
May only be used to pass to clearInterval.
- Annotations
- @RawJSType()
-
sealed
trait
SetTimeoutHandle extends Any
Non-Standard A handle returned from a call to setTimeout.
Non-Standard A handle returned from a call to setTimeout.
May only be used to pass to clearTimeout.
- Annotations
- @RawJSType()
Value Members
-
def
clearInterval(handle: SetIntervalHandle): Unit
Cancel an interval execution
Cancel an interval execution
- handle
The handle returned by setInterval.
- Note
Uses JavaScript's non-standard
clearInterval
-
def
clearTimeout(handle: SetTimeoutHandle): Unit
Cancel a timeout execution
Cancel a timeout execution
- handle
The handle returned by setTimeout.
- Note
Uses JavaScript's non-standard
clearTimeout
-
def
setInterval(interval: FiniteDuration)(body: ⇒ Unit): SetIntervalHandle
Schedule something for repeated execution every duration.
Schedule something for repeated execution every duration.
- interval
duration between executions
- body
code to execute after each
interval
- returns
A handle that can be used to cancel the interval by passing it to clearInterval.
- Note
Uses JavaScript's non-standard
setInterval
-
def
setInterval(interval: Double)(body: ⇒ Unit): SetIntervalHandle
Schedule something for repeated execution every
interval
milliseconds.Schedule something for repeated execution every
interval
milliseconds.- interval
duration in milliseconds between executions
- body
code to execute after each
interval
- returns
A handle that can be used to cancel the interval by passing it to clearInterval.
- Note
Uses JavaScript's non-standard
setInterval
-
def
setTimeout(interval: FiniteDuration)(body: ⇒ Unit): SetTimeoutHandle
Schedule something for execution after a duration.
Schedule something for execution after a duration.
- interval
duration to wait
- body
code to execute after
interval
has passed- returns
A handle that can be used to cancel the timeout by passing it to clearTimeout.
- Note
Uses JavaScript's non-standard
setTimeout
-
def
setTimeout(interval: Double)(body: ⇒ Unit): SetTimeoutHandle
Schedule something for execution in
interval
milliseconds.Schedule something for execution in
interval
milliseconds.- interval
duration in milliseconds to wait
- body
code to execute after
interval
has passed- returns
A handle that can be used to cancel the timeout by passing it to clearTimeout.
- Note
Uses JavaScript's non-standard
setTimeout
-
object
RawTimers extends Object
Non-Standard Raw JavaScript timer methods.
Non-Standard Raw JavaScript timer methods.
The methods on this object expose the raw JavaScript methods for timers. In general it is more advisable to use the methods directly defined on timers as they are more Scala-like.
- Annotations
- @native() @JSGlobalScope()