sandbox-agent/foundry/packages/client/src/mock/latency.ts
Nathan Flurry d75e8c31d1
Rename Foundry handoffs to tasks (#239)
* Restore foundry onboarding stack

* Consolidate foundry rename

* Create foundry tasks without prompts

* Rename Foundry handoffs to tasks
2026-03-11 13:23:54 -07:00

12 lines
369 B
TypeScript

const MOCK_LATENCY_MIN_MS = 1;
const MOCK_LATENCY_MAX_MS = 200;
export function randomMockLatencyMs(): number {
return Math.floor(Math.random() * (MOCK_LATENCY_MAX_MS - MOCK_LATENCY_MIN_MS + 1)) + MOCK_LATENCY_MIN_MS;
}
export function injectMockLatency(): Promise<void> {
return new Promise((resolve) => {
setTimeout(resolve, randomMockLatencyMs());
});
}