Check if the monkey loop should terminate.
(action_count: int, count: int | None, start: float, duration: float | None)
| 24 | |
| 25 | |
| 26 | def _should_stop(action_count: int, count: int | None, start: float, duration: float | None) -> bool: |
| 27 | """Check if the monkey loop should terminate.""" |
| 28 | if count is not None and action_count >= count: |
| 29 | return True |
| 30 | return duration is not None and (time.time() - start) >= duration |
| 31 | |
| 32 | |
| 33 | class MonkeyRunner: |