function async_wait(delay) {
    return new Promise((resolve, reject) => setTimeout((res) => res(), delay, resolve));
}
Returns a promise which is resolved after provided delay in milliseconds.

@param {Number} delay
@returns {Promise}