Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
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
1
const
sleep = (ms) =>
new
Promise((res) => setTimeout(res, ms));
// <1>
2
3
function
asyncOnMessageWrap(fn) {
// <2>
4
return
async
function
(msg) {
Callers
3
square_sum
Function · 0.85
fibonacci
Function · 0.85
bad
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected