4 ms·
We use this method where I work :) It's true that if the thread hasn't finished by the end of the time limit, an exception will be raised and the thread will ke
by z0r 15y ago
We use this method where I work :) It's true that if the thread hasn't finished by the end of the time limit, an exception will be raised and the thread will keep running. Part of our solution is that the thread is also aware of the time limit. It checks to see if it has timed out at regular intervals during its calculations, and quickly exits itself if it has expired. It's not the prettiest thing on earth, but it gets the job done for us