Minute Counter in Javascript

Hi. I’m doing a website called wastedminutes.com and I would like a counter at the top telling the user how many minutes they’ve wasted on the website.
Can anyone give me some Javascript code with which to achieve this?
Preferably it would keep a running counter without having to refresh the page.
Is javascript the right thing to be using?

Thanks