I'm looking for a Javascript library to be able to measure the time a div (or any other object) has been in "focus" (as in: the browser is showing and the window is focused; not the normal Javascript focus event).
Do you know if something like that exists ? or something similar I can tweak?
Edit: Ok. Rephrased to avoid misunderstandings.