function mysleep(func,time){ return function(){ console.log(func,time,"ccc") setTimeout(()=>{ func(); },time); } } function a(){ console.log('sleep') } let s = mysleep(a,1000) s()