MCPcopy
hub / github.com/mongodb/node-mongodb-native / runLater

Function runLater

test/tools/utils.ts:202–206  ·  view source on GitHub ↗
(fn: () => Promise<void>, ms: number)

Source from the content-addressed store, hash-verified

200 * @param ms - timeout in MS
201 */
202export const runLater = (fn: () => Promise<void>, ms: number) => {
203 return new Promise<void>((resolve, reject) => {
204 setTimeout(() => fn().then(resolve).catch(reject), ms);
205 });
206};
207
208export const sleep = promisify(setTimeout);
209

Callers 1

testFunction · 0.90

Calls 1

fnFunction · 0.50

Tested by 1

testFunction · 0.72