We wrote a plug-in for our IDE (IntelliJ in our case) that keeps track of time spent per project automatically. The IDE's API lets you list for events like edits, changing windows, etc., so we log a record every time something like that happens. The reporting module looks at this raw data and determines the total time spent per project by comparing timestamps between records. If the difference is greater than 5 minutes, it assumes no work was done during this time.
It's not perfect and it's not 100% accurate but you do eliminate all the overheard of manually tracking this stuff yourself through some external tool.