()
| 35 | ): Promise<void> { |
| 36 | return new Promise((resolve) => { |
| 37 | const check = () => { |
| 38 | if (isCancelled()) { |
| 39 | resolve(); |
| 40 | return; |
| 41 | } |
| 42 | const sinceChangeMs = nowMs() - getLastFrameChangeMs(); |
| 43 | if (sinceChangeMs >= idleMs) { |
| 44 | resolve(); |
| 45 | return; |
| 46 | } |
| 47 | setTimeout(check, Math.max(16, idleMs - sinceChangeMs)); |
| 48 | }; |
| 49 | check(); |
| 50 | }); |
| 51 | } |
no test coverage detected