Next time you're sweating a work problem, stressing about planning a project, or trying to tame a flare-up with a coworker, take heart in this: You may be giving your brain a boost that will help you grow old gracefully.

In a study just published in the journal Neurology, researchers at Germany's University of Leipzig gave 1,054 people over age 75 tests that measured their memory and thinking abilities, then repeated the tests over the course of eight years. They also interviewed participants about their work history. People who had jobs that involved high levels of scheduling, developing strategies, resolving conflicts, analyzing data, and evaluating and interpreting information tended to score the best—and also had the slowest rate of cognitive decline.

RELATED: 17 Ways to Age-Proof Your Brain

"Our study is important because it suggests that the type of work you do throughout your career may have even more significance on your brain health than your education does," said study author Francisca S. Then, PhD, in a release. As she also noted, "Challenges at work may indeed be a positive element, if they build up a person's mental reserve in the long-term."

In other words, what doesn't kill you makes you stronger. Take that, work stress!

RELATED: Best and Worst Jobs For Your Health