It is not so useful as you can't cancel generic tasks, so the task will continue to run and the program state will be more complicated.
The timeout should be implemented in the task itself. This is already implemented in network calls, http requests and many other places where it makes sense.
I've seen the example, but it's very intricate to make.
It would be useful to have a timeout directly in the wait, when necessary, which closes the wait and continues with the execution of the next line.