static measureAsyncFunction(func) {
    return (async () => {
      const start = Date.now();
      const output = await func; // is a promise
      const end = Date.now();
      return { output, duration: (end - start) / 1000 };
    })();
  }
Wraps a function and logs the duration (in seconds) of the function call.
@param {Function} func
@returns {Promise<{output: any, duration: number}>}