I use https://wakatime.com for this. I use a Git branch for each feature/Jira ticket and at the end of the day WakaTime tells me how long I coded in each branch.
Looks interesting, can it distinguish time spent in the browser, so one would know if time was spent on pull request #33 rather than on Twitter?
It's more for coding time, using the text editor plugins not browsing time. Using the api you can distinguish between browsing activity and coding activity, but the website displays it as the same activity right now.