var blah = require('wait.for');
var wait = require('wait.for/parallel-tests');
function testFunction(){
console.log('fiber start');
wait.miliseconds(10*1000);
console.log('fiber end');
};
console.log('app start');
blah.launchFiber(testFunction);
console.log('after launch');
나는 다음과 같은 출력 내가 잘못 뭐하는 거지wait.for를 사용하는 방법?
app start
fiber start
Z:\nodeplayground\node_modules\wait.for\waitfor.js:15
Fiber(function(){ fn.apply(null, newargs)}).run(); //launch new fiber,
call the fn with the args, this=null (strict)
^
TypeError: wait.miliseconds is not a function
at testFunction (Z:\nodeplayground\index.js:8:10)
at Z:\nodeplayground\node_modules\wait.for\waitfor.js:15:31
를 얻을 수 위의 코드를 실행하려고?
내가 달성하고자하는 주요 기능은 다음과
function testFunction2(){
function Innerfunction(){
setTimeout(function(){
console.log("hello");
},5000);
console.log("After setTimeout")
}
}
내가 위의 코드를 5 초 인쇄 "안녕하세요" 기다려야 할 것입니다 및 "에서는 setTimeout 후"그 후.