You're working on your project and iterating on, for instance, UI fixes. Compiling and launching your project takes 20 seconds. What do you do during these 20 seconds? (eg. read the news, Twitter, …) Do you feel it affects your focus?
20-40 seconds? That's not enough time for a full context switch.<p>Take an eye break (look at something more than 20 feet away). Stand and stretch your back. Do a few desk-friendly stretches or exercises (curls, squats). Go to the kitchen for a beverage refill.<p>Somewhere around the 5 min mark for a wait it becomes time to check email, etc.
I like to use Focus (<a href="https://heyfocus.com/" rel="nofollow">https://heyfocus.com/</a>) on the Mac to prevent myself from actually doing these context switches.
Wow, old days, working with clipper, it took between 15 and 40 minutes. We went to the bar and hoped the compiler didnt break the moment we entered the bar.