function a() {
setTimeout(()=>{
console.log(123)
},2000)
}
function b() {console.log(9999)}
async function wrap() {
await a()
await b()
}
wrap()
const call = (func, delay) => new Promise((r) => setTimeout(() => r(func()), delay));
function a() {
console.log(123);
}
async function wrap() {
await call(a, 2000);
b()
}