The resolved value of promise.
The operation to bound.
The deadline in milliseconds; undefined/Infinity disables the timeout.
Optionallabel: string
A short name for the operation, used in the timeout message (default
"operation").
A promise that settles with promise's result or rejects with TimeoutError.
Rejects with TimeoutError if
promisedoes not settle withinmsmilliseconds.When
msisundefinedorInfinitythe original promise is returned unchanged (no timer is armed), so a caller can pass an optional deadline straight through. Otherwise the returned promise settles with whichever happens first:promiseresolving/rejecting, or the deadline elapsing. The internal timer is always cleared once the race settles.