MCPcopy Index your code
hub / github.com/MultithreadedJSBook/code-samples / sleep

Function sleep

ch2-patterns/worker.js:1–1  ·  view source on GitHub ↗
(ms)

Source from the content-addressed store, hash-verified

1const sleep = (ms) => new Promise((res) => setTimeout(res, ms)); // <1>
2
3function asyncOnMessageWrap(fn) { // <2>
4 return async function(msg) {

Callers 3

square_sumFunction · 0.85
fibonacciFunction · 0.85
badFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected