The promise to wrap.
The number of milliseconds to wait before timing out.
Optional
message: stringOptional error message to use when the promise times out.
A new promise that resolves or rejects with the same value as the original promise, or rejects with a TimeoutError if the promise times out.
Wraps a promise with a timeout. If the promise does not resolve or reject within the specified time, the promise will reject with a TimeoutError.