Couldn't it be done with the log files of your versioning system? Problem is maybe to know when you started. Maybe if you used git so as to always branch for new features, it would work.
Actually I'd like to see the per-line editing time combined with the VCS logs. Which lines contributed to the most bugs? What lines do people have to refer to the most when they're making patches? Are there parts of the code that people work more slowly in?