sb.timerSetInterval
sb.timerSetInterval(function, interval)
This function creates a repeating timer which fires every "interval" milliseconds and then executes "function"
Parameters
| Parameter | Type | Description |
|---|---|---|
function | function | The function to be called when the timer fires. |
interval | number | The time in milliseconds of how often the timer should fire. |
Returns
| Type | Description |
|---|---|
string | An id for the timer. |
Example
var idval;
function cbFunc() {
print("CB FUNC HAS BEEN CALLED");
}
//Call cbFunc every 2 seconds
function cbSetInterval() {
idval = sb.timerSetInterval(cbFunc, 2000);
}