there are lots of webtools for this sort of thing, used in project management etc.
a simpler one I've used with some clients is called
Toggl there's a web app and a desktop app and you can create projects in it, and graph them etc. Naturally you must click a button to start/ stop tracking. I bet there's an API and you could make a Max device to automate if you really cared.
Toggl is OK, about as crappy as any of these fremium webapps which will try and upsell you at every corner. it is free for basic use though, and gloriously simple