1.0.5 • Published 5 years ago
wst-first-bag v1.0.5
##更新guohou
function timeout(time){
    return new Promise((resolve,reject)=>{
        setTimeout(()=>{
            resolve();
        },time);
    })
}
async function asyncPrintf(){
    await timeout(5000).then(()=>{
        console.log(5);
    });
    await timeout(3000).then(()=>{
        console.log(3);
    });
    await timeout(2000).then(()=>{
        console.log(2);
    });
    await timeout(4000).then(()=>{
        console.log(4);
    });
    await timeout(1000).then(()=>{
        console.log(1);
    });
}
    asyncPrintf();