Closed as an exact duplicate of this question.
When I write C++ code I compile frequently so that I can see that I'm not making a mistake or what errors to fix next.
However, that practice is unfortunately highly inefficient, especially with bigger projects that take a long time to compile. Even if compilation takes only 30 seconds or a minute it adds up to be a big waste of time over the day.
How do you deal with longish compile times? Do you just not compile often? During compile times, what works best for you as a time filler? Look at the code some more? But that can disturb the compiling process. Quickly switch to some other coding project you're working on? Read an article?
In terms of cognition it's quite an interesting question: How do you deal with frequent forced one-minute interruptions without losing your focus?