Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041/** Resolves after a specified delay in milliseconds. Wraps `setTimeout` in a promise. @param ms - delay before the returned promise resolves @returns promise that resolves to `undefined` after `ms` milliseconds @example ```ts import { wait, } from '\@monochromatic-dev/module-async-time'; await wait(1000,); ``` @example Throttle a loop: ```ts for (const item of items) { await process(item,); await wait(200,); } ``` */export function wait(ms: number,): Promise<undefined> { /** Promise capability created locally rather than borrowed from executor input. */ const { promise, resolve, } = Promise.withResolvers<undefined>(); setTimeout( function resolveAfterDelay(): void { resolve(undefined,); }, ms, ); return promise;}