Bind a timeout to an asynchronous task.
The real asynchronous task is still running even if the timeout is reached. If you wanna cancel/abort the task, you should consider using AbortController.
The timeout duration in milliseconds.
The asynchronous task to execute, which can be a Promise or a function that returns a Promise.
A Promise with the result of the asynchronous task or a timeout error.
If the asynchronous task does not complete within the specified timeout.
Bind a timeout to an asynchronous task.