RescueTime is a software tool that tracks the applications and sites you use, and can give you good (if somewhat confronting) feedback on the actual amount of time you spend working (and doing anything but working).
The tracking and weekly feedback alone helps me keep more focussed, but setting it up to block distracting sites (such as Youtube and Facebook) during the first half hour after my morning routine, and breaking 1h distraction times, has been really useful to me.