mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
07c4e404b2
The runner guarantees a 250 ms gap between activating a target and the first interaction on it. It implemented that as a 250 ms sleep taken *at* the interaction, so the gap was charged again however much of it had already passed — and in an agent-driven flow the client round trip alone is 190-260 ms, so almost all of it had. Record when the window closes on the monotonic uptime clock at each of the three activation points, and wait only for what is left of it. A caller that already spent the window waits for nothing; a tight loop still gets the whole guard. The guarantee is unchanged, and nothing downstream re-pays the wait. Refs #2381.