This is a really neat app, RescueTime, it is free with a paid version as well.
It allows you to set goals to help keep you on track. You can see how much time is spent on your computer. You can also set an alarm to tell you when you spent more than 2 hours on Facebook.
I have not set this up yet, but am intrigued.