Core.Timer Class
Defined in:
samsara/core/Timer.js:14
A collection of timing utilities meant to translate the familiar setInterval, setTimeout timers to use Samsara's internal clock, which is backed by a requestAnimationFrame (RAF) loop. It also includes other helpful methods for debouncing.
Item Index
Methods
- after static
- clear static
- debounce static
- every static
- frameDebounce static
- setInterval static
- setTimeout static
Methods
after
(
Function
static
-
handler
-
numTicks
Wraps a function to be invoked after a specified number of Engine ticks.
Parameters:
Returns:
every
(
Function
static
-
handler
-
numTicks
Wraps a function to be invoked every specified number of Engine ticks.
Returns:
frameDebounce
(
Function
static
-
handler
-
numFrames
Debounces a function for a specified number of Engine frames.
Returns:
setInterval
(
Function
static
-
handler
-
interval
Wraps a function to be invoked at repeated intervals.
Parameters:
Returns:
setTimeout
(
Function
static
-
handler
-
duration
Wraps a function to be invoked after a certain amount of time. After a set duration has passed, it executes the function.