I need to know if it is possible to call a subroutine with a
timeout so that after the timeout period, the subroutine will
automatically terminate like a process kill.
Currently, the subroutine has not thrown an exception yet so I
can't do anything with it.
But if it runs for more than a few seconds, then this means that it
has hanged and I want to terminate the running of this subroutine
automatically after the timeout period.
In case anyone is wondering, the subroutine is from a component and
I don't know how the code in it works.
Any help in the right direction would be helpful.