(ms)
| 4189 | } |
| 4190 | |
| 4191 | async function sleepWithStop(ms) { |
| 4192 | const start = Date.now(); |
| 4193 | while (Date.now() - start < ms) { |
| 4194 | throwIfStopped(); |
| 4195 | await new Promise(r => setTimeout(r, Math.min(100, ms - (Date.now() - start)))); |
| 4196 | } |
| 4197 | } |
| 4198 | |
| 4199 | async function humanStepDelay(min = HUMAN_STEP_DELAY_MIN, max = HUMAN_STEP_DELAY_MAX) { |
| 4200 | const duration = Math.floor(Math.random() * (max - min + 1)) + min; |
no test coverage detected