* Set the wait time before terminating the attempt to execute a command * and generating an error.
(ms: number)
| 373 | * and generating an error. |
| 374 | */ |
| 375 | setTimeout(ms: number) { |
| 376 | if (!this._commandTimeoutTimer) { |
| 377 | this._commandTimeoutTimer = setTimeout(() => { |
| 378 | if (!this.isResolved) { |
| 379 | this.reject(new Error("Command timed out")); |
| 380 | } |
| 381 | }, ms); |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | /** |
| 386 | * Set a timeout for blocking commands. |
no test coverage detected