Also you could think about the kind of things which make you want to browse the net, check your email, etc. For example, if a build I'm working on is taking too long my mind will wander.
So it actually pays off to make the build process as quick and efficient as you can make it, so you can make changes and test quickly.
I also find it helps to get enough sleep (tiredness is bad for concentration) and not to drink too much caffeine (seriously. I feel so much better after cutting down the amount of caffeine I drink. Try naturally caffeine free teas!)
(I seem to have wandered slightly off-topic into concentration there... still, I find the better I can concentrate the better I will use time!)