function wait(duration = 0) {
    return new Promise(resolve => delayedCall(duration, resolve));
}
Defers by the specified duration.

@export
@param {number} [duration=0] Time to wait in milliseconds.
@returns {Promise}
@example
await wait(250);