The function to execute
Configuration options
OptionalabortController?: AbortControllerAbort controller to cancel the operation
OptionalonError?: (error: Error, didTimeout: boolean) => voidCapture errors
OptionalonTimeout?: (error: TimeoutError) => voidOn timeout callback
Optionalthrows?: booleanRethrow errors
Timeout in milliseconds after which the function will be rejected
The result of the function execution
Tries to execute a function with a timeout. If the function exceeds the timeout, it will reject with a TimeoutError.