Constructor
new Interval(callback, time, startopt, instantFirstRunopt)
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function | function to be called when given time passes | |
time |
number | time in ms to fire the callback | |
start |
boolean |
<optional> |
start the interval |
instantFirstRun |
boolean |
<optional> |
run the callback instantly |
Methods
start(newTimeopt, instantFirstRunopt) → {Interval}
- Source:
Starts or restarts the interval run
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
newTime |
number |
<optional> |
override time to call the callback |
instantFirstRun |
boolean |
<optional> |
run the callback instantly |
Returns:
- current instance
- Type
- Interval
stop() → {Interval}
- Source:
Stops the interval, so callback won't be fired anymore
Returns:
- current instance
- Type
- Interval