Races a promise with a timeout, rejecting with a TimeoutError if the timeout is reached before the provided promise.
The promise to race against a timeout.
Optional
The number of seconds to wait. If undefined, the promise is returned without wrapping.
The message to set in the TimeoutError.
Races a promise with a timeout, rejecting with a TimeoutError if the timeout is reached before the provided promise.