I\'m having a function returning a promise. In this function, we call a third party vender to send some push notification through their server.
it looks like
The short version:
function wait(milliseconds) { return new Promise(resolve => setTimeout(resolve, milliseconds)); }
Example:
async function myFunc(user) { await wait(3000); sendMessage(user.name); }