resolver = (resolve, reject) => {
    'use strict';
    const timeoutId = this.timeout(() => {
      'use strict';
      const elapsed = this.now() - start;
      reject(new Error(`${errorMsg}\nElapsed time: ${elapsed} ms.`));
    }, timeoutInMs);
    const clearTimeout = () => {
      this.clearTimeout(timeoutId);
    };
    promise.then(clearTimeout, clearTimeout);
    promise.then(resolve, reject);
  }
@param {function(?)} resolve
@param {function(*)} reject