If I am correct, you could write a simple app that keeps track of how long a given application (e.g., XCode) is active (as in foreground) and present you with some sort of summary log that you could decipher. Of course, if you have to go spend half an hour in the "reading room" and leave XCode active, that might skew the numbers, unless you have auto-sleep and are getting notifications for that as well.