Interestingly I wrote something very similar to tagtime a number of years ago, and am still using it. I don't do random sampling (didn't think of it at the time), but at 15 minute intervals. I've got short cuts and defaults to remember the last thing I was working on, automatic (and manual) time division when I've worked on multiple projects in the interval. Over the last year, I've gotten it the point where it automatically fills in timesheets for me. Mine too is Perl.
Of course, this sort of thing only works as long as you're honest about what you're working on. Sometimes I'm very good about being honest when I've gone off-task, sometimes less so. But it's easy to go back through my logs and find out how much time I've wasted when I intended to be working.
Ooh, you should check out tagtime on github -- http://tagti.me -- and see if we can join forces on this. I think it's important to have Poisson-distributed sampling because otherwise you can anticipate the next ping and insert a bias into the tracking (even if you're trying to be perfectly honest -- in fact, you might try too hard and overcompensate, inserting the opposite bias). If the pings are Poisson then that's impossible.
I want to test different techniques for decreasing personal procrastination. What would be an easy way to measure procrastination so that I can do the comparison?
I would also like to hear suggestions for measuring the inverse i.e. how can I measure getting-things-done-ness.