Here's a suggestion:
Mark the time when starting the thread.
Then during the script run, add a time check action and compare the time difference with your desired value.
-> Take appropriate action.
This is very important bug that already here for more than 1 years (at least what i know) and that need to be resolved asap but somehow the developer dont solve it, this bug make website can detect the bot