(ms)
| 28 | // --- Portable helpers --- |
| 29 | |
| 30 | function sleepMs(ms) { |
| 31 | var delay = Math.max(0, Math.floor(Number(ms) || 0)); |
| 32 | if (delay <= 0) return; |
| 33 | // Atomics.wait blocks without spawning a subprocess; works on all platforms. |
| 34 | Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, delay); |
| 35 | } |
| 36 | |
| 37 | function execText(command) { |
| 38 | return execSync(command, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], maxBuffer: MAX_EXEC_BUFFER }); |