MCPcopy Create free account
hub / github.com/course-dasheng/fe-algorithm / sleep

Function sleep

interview/limit.js:45–53  ·  view source on GitHub ↗
(n,name='test')

Source from the content-addressed store, hash-verified

43
44}
45async function sleep(n,name='test'){
46 return new Promise(resolve=>{
47 console.log(n,name,'start')
48 setTimeout(()=>{
49 console.log(n,name,'end','-------------')
50 resolve({n,name})
51 },n*1000)
52 })
53}
54
55async function start(){
56 let runner = limit(2) //并发量是3

Callers 1

startFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected