When I'm working on software, I find that as soon as I have to wait more than around 6 seconds for the compiler or for the program to start (or simply for Visual Studio to process some really complicated command like, say, Space Bar), I tend to fire up the email client, or go read stuff on the Internet, or post questions on StackOverflow.
Do you know the problem? How do you keep focused? Is there some maintenance task that can be done in the meantime that does not get in the way of your concentration?
(My build is finished, I can go back to working now)
Carl