* Calls a function continously at the specified interval. See setTimeout to call function a single time. * @param fn - the function to execute * @param delay - the number of milliseconds (thousandths of a second) on how often to execute the function * @param [pauseable] - respects the pause s
( fn: (...args: any[]) => any, delay: number, pauseable?: boolean, ...args: any[] )
| 166 | * me.timer.setInterval(myFunction, 1000, true, param1, param2); |
| 167 | */ |
| 168 | setInterval( |
| 169 | fn: (...args: any[]) => any, |
| 170 | delay: number, |
| 171 | pauseable?: boolean, |
| 172 | ...args: any[] |
| 173 | ) { |
| 174 | this.timers.push({ |
| 175 | fn: fn, |
| 176 | delay: delay, |
| 177 | elapsed: 0, |
| 178 | repeat: true, |
| 179 | timerId: ++this.timerId, |
| 180 | pauseable: pauseable === true || true, |
| 181 | args: args, |
| 182 | }); |
| 183 | return this.timerId; |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Cancels a timeout previously established by calling setTimeout(). |
no test coverage detected