Create a promise with a timeout.
By default rejects with PromiseTimeoutError on timeout but you can override by supplying cancel.
the timeout in milliseconds
a promise that resolves or rejects when the timed task completes
Optional
invoked on timeout (default implementation throws PromiseTimeoutError)
Create a promise with a timeout.
By default rejects with PromiseTimeoutError on timeout but you can override by supplying cancel.