Do you really need a script to calculate this? ;-) ...
Time spent goofing around on perlmonks.org:   90.0%
Time spent drinking coffee and thinking about getting around to real work: 9.0%
;-) ;-) ;-)
In all seriousness, it is extremely useful to actually measure how you spend your day, how much time it actually takes to solve a problem, how accurate your initial rosy estimates were vs. what actually happened (read: “why you are working so hard and still losing money”), how much time you spend talking to people (who aren’t paying you), and so on. It’s strange how you think you know what you’re doing all day every day ... because, well, you do it all day every day ... but when you measure, you find out how very different your perceptions actually are from what takes place.