The function you are searching for is:
timout in ms. This function is documented.
simply wraps the callback in a time diff block that will display an error message when the diff is too high (the "A plugin may be making Sublime Text unresponsive" message from event listeners). It won't solve your thread issues. Also, it is ST2 only and the ST3 API in general is thread-safe.