标签:div res get lin ons syn turn function resolved
function resolveAfter2Seconds() { return new Promise(resolve => { setTimeout(() => { resolve(‘resolved‘) }, 2000) }) } async function asyncCall() { console.log(‘calling start at: ‘ + new Date().getSeconds()) const result = await resolveAfter2Seconds() console.log(result + ‘ at: ‘ + new Date().getSeconds()) } asyncCall()
//
calling start at: 48
resolved at: 50
标签:div res get lin ons syn turn function resolved
原文地址:https://www.cnblogs.com/anch/p/12200394.html