MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / waitUntil

Function waitUntil

scripts/bench/agent-control-benchmark.mjs:1324–1333  ·  view source on GitHub ↗
(predicate, timeoutMs)

Source from the content-addressed store, hash-verified

1322}
1323
1324async function waitUntil(predicate, timeoutMs) {
1325 const deadline = performance.now() + timeoutMs;
1326 while (performance.now() < deadline) {
1327 if (await predicate()) {
1328 return true;
1329 }
1330 await sleep(250);
1331 }
1332 return false;
1333}
1334
1335function freePort() {
1336 return new Promise((resolve, reject) => {

Callers 1

startArgentToolServerFunction · 0.85

Calls 1

sleepFunction · 0.70

Tested by

no test coverage detected