Pomodoro helps to contain that. The idea is that you keep an egg timer handy, and you break down your work into twenty-five minute long sessions followed by short (five minute) breaks. After every four sessions (about two hours), you take a longer fifteen to thirty minute break.