I often hear rationalists seeking out things like this, but I've yet to hear any of them outright assert or even imply that this is a useful thing to do. I myself have thought about such things before, and my answer has been that I switch tabs and contexts too rapidly to accurately measure these things. In order to get anywhere near effective measurements, I'd need interfaces magnitude orders more pluggable than existing software implementations allow. (Firefox, for example does not value programmability or pluggability, but rather extensibility.) Despite the usefulness of such projects, they will take considerable effort, and I've simply not been able to motivate myself to bother simply for the sake of tracking time spent. I won't argue it doesn't have any benefits, even known benefits, but I have yet to see any kind of evidence that it is legitimately useful. Perhaps the evidence is not found in the places I've expected it to be thus far.
If anyone can justify the benefits or give me tangible evidence of any such thing, I would appreciate it.
I have basically this problem (I'm fairly sure it's tied into my ADHD). As noted below, RescueTime is an excellent solution: it'll keep track of different tabs in the same program separately, do it automatically, and do it down to the second - so you get a very accurate result at the end. I've found some very valuable results from this - for starters, that I work only about 50% of my "work hours" even on a good day, and that I spend much more time on random surfing than I thought I did.
I currently log the total number of hours I work each day in an OpenOffice Spreadsheet. I input the start time, lunch/break time, and end time, and it calculates the total hours worked. I'm not savvy enough to create this type of spreadsheet myself, so I looked through a large number of templates online before finding one that works as I've described above. I'm still not crazy about the way that this spreadsheet is laid out.
If you can link to a spreadsheet available for download similar to the one described above, please do so in the comments.
If you use time-logging for various distinct projects throughout the day, please describe this process and link to the software you use (if possible).
More of a meta-discussion: how time-logging this enhanced your performance or time management?, for what types of projects/activities is it best to time-log?, general comments about the idea