The 1self visual studio plugin automatically allows you to track how long you spend actively developing, and how long your builds take. The data is sent automatically to 1self, where you can analyze it.
For instance, you can see a barchart of build times. Or a bar chart of how long you spent coding on each day. You can also correlate it with your github pushes and commits, if you add the github integration too.
No source code information is sent up. For more information see http://www.1self.co/ and http://www.1self.co/privacy.html
The code is open source, you can look at it here: https://github.com/1self/visual-studio-plugin