How to automatically reload a page after a given period of inactivity

How do I automatically reload a page after a given period of inactivity? I want to add this function to a page on my site. I can only find script that reloads the page even if I am working on the page (typing something in a form).

thanks,