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.
Each asynchronous function started, starts in separate thread.
So in that example you will have 2 threads since 2 asynchronous functions
will be started, each with its own (different) script.