* Calls a function once after a specified delay. See me.timer.setInterval to repeativly call a function. * @param fn - the function you want to execute after delay milliseconds. * @param delay - the number of milliseconds (thousandths of a second) that the function call should be delayed by. *
( fn: (...args: any[]) => any, delay: number, pauseable?: boolean, ...args: any[] )
| 135 | * me.timer.setTimeout(myFunction, 1000, true, param1, param2); |
| 136 | */ |
| 137 | setTimeout( |
| 138 | fn: (...args: any[]) => any, |
| 139 | delay: number, |
| 140 | pauseable?: boolean, |
| 141 | ...args: any[] |
| 142 | ) { |
| 143 | this.timers.push({ |
| 144 | fn: fn, |
| 145 | delay: delay, |
| 146 | elapsed: 0, |
| 147 | repeat: false, |
| 148 | timerId: ++this.timerId, |
| 149 | pauseable: pauseable ?? true, |
| 150 | args: args, |
| 151 | }); |
| 152 | return this.timerId; |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Calls a function continously at the specified interval. See setTimeout to call function a single time. |
no test coverage detected