队列示例
var array = [1,2,3,4];
function check()
{
if(array.length > 0)
var url = array.pop();
load(url);
}}
function load(url)
{
http.get(url, function(res){
check();
)
}}
我想在 每次load(url)的时候 延迟6秒 这时候我用setTimeout 没什么效果
黄舟2017-04-17 15:56:35
It’s best to format it when sending the code! Dear
If you use setTimeout to implement it, you need to recurse
PHPz2017-04-17 15:56:35
The timing function can be written like this
var a = function(){
//逻辑
setTimeout(() => {
a()
}, time)
}
I don’t know if that’s what you want