Running a thread for some fixed time and killing it if time is out

Viewed 197

I want to run a thread for some fixed amount of time.
If it is not completed within that time, I want to either kill it, throw some exception, or handle it in some way. How can this be done?

1 Answers
Related