How to set a function to execute later in Javascript if it will take a long time?

function wait() {
    let a = Date.now()
    while (Date.now() - a < 3000) {
        //loop
    }
    console.log('waiting ends...')
}
function start(){
    console.log('starts...')
    wait()
}
function end(){
    console.log('ends...')
}

start()
end()

How can I set wait() execute asynchronously that lead to a output of “starts…, ends…, waiting ends…” without apply setTimeout function to wait()?