"Every time you switch your attention from one target to another and then back again, there's a cost," Cal Newport said in a New York Times interview. "This switching creates an effect that psychologists call attention residue, which can reduce your cognitive capacity for a non-trivial amount of time before it clears." Newport has a new book that explores this and related ideas, called Digital Minimalism.
From the New York Times:
The second rule is to "embrace boredom." The broader point here is that the ability to concentrate is a skill that you have to train if you expect to do it well. A simple way to get started training this ability is to frequently expose yourself to boredom. If you instead always whip out your phone and bathe yourself in novel stimuli at the slightest hint of boredom, your brain will build a Pavlovian connection between boredom and stimuli, which means that when it comes time to think deeply about something (a boring task, at least in the sense that it lacks moment-to-moment novelty), your brain won't tolerate it.