function delay(ms) {
  return new Promise((resolve) => setTimeout(resolve, ms));
}
Returns a promise that resolves after a given amount of time.

@param {Number} ms Amount of milliseconds to wait
@return {Promise} Promise that resolves after `ms` milliseconds
@private