Constructor
new Heartbeat()
Collects callback functions and executes them at a specified interval
- Source:
Methods
-
getBeatSkips() → {number}
-
Returns the number of beats to skip
- Source:
Returns:
- Type
- number
-
getCallbacks() → {Callbacks}
-
Returns the callback queue
- Source:
Returns:
- Type
- Callbacks
-
getClassDisplayName() → {String}
-
Returns the display name of the class
- Source:
Returns:
"stopped", "started", "delayed"- Type
- String
-
getPulse() → {Number}
-
Returns the pulse interval
- Source:
Returns:
- Type
- Number
-
getState() → {String}
-
Returns the state of the heartbeat
- Source:
Returns:
- Type
- String
-
setPulse(pulse)
-
Sets the pulse interval
Parameters:
Name Type Description pulse
number Callback execution interval (milliseconds) - Source:
-
skip(beatsopt, addopt)
-
Skip a number of beats
Parameters:
Name Type Attributes Default Description beats
number <optional>
1 Number of beats to skip add
boolean <optional>
true Whether to add the skips instead of replacing - Source:
-
start(pulseopt)
-
Starts the heartbeat
Parameters:
Name Type Attributes Description pulse
number <optional>
Callback execution interval (milliseconds) - Source:
-
stop()
-
Stops callback execution
- Source: