I do the same and it really helps my productivity. I have no clue why it actually works, but I've been using the strategy successfully for a few years now. I always suggest the idea to a coworker if they're stuck on a problem or find themselves unmotivated.