Does anyone know how I can write a Javacript function which returns true if the browser's Javascript engine has been idle for a certain amount of time?
I am happy to use mootools / jQuery etc if easier, with a slight preference for mootools.
EDIT:
My actual problem: I'm making a call to a 3rd party's API. The call returns immediately but the actual work it does to the DOM goes on for some time (> 10 seconds in many cases). I want some code of mine to run as soon as the DOM work is complete. I know nothing about the internals of the API function I'm calling, so I was looking for a generic way of determining whether the function had finished.