摘要: //这种情况无法sleep,先输出xix,再输出FUCK3次sec = 3;int_id = setInterval(function(){ sec--; alert("FUCK"); if(sec <= 0) clearInterval(int_id);},1000);alert("xix"); //300毫秒后执行function中逻辑(不阻塞),先输出xixsetTimeout(function(){ console.log("execute");},300)alert("xix"); 阅读全文
posted @ 2013-12-19 17:23 apeipo 阅读(108) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-12-19 17:20 apeipo 阅读(82) 评论(0) 推荐(0)