The next time a chocolate craving strikes you while at work, if you want to resist indulging, try heading out for a brisk walk.

Taking a 15-minute walk cut the amount chocolate people ate by nearly half, according to a new study.

"We know that snacking on high-calorie foods, like chocolate, at work can become a mindless habit and can lead to weight gain over time," study researcher Adrian Taylor, a professor at the University of Exeter in the United Kingdom, said in a statement.

Taylor and his colleagues set out to determine whether physical activity could curb chocolate cravings. They asked 78 regular chocolate-eaters to abstain from chocolate for two days, and split them up into four groups.

Two groups took a brisk 15-minute walk on a treadmill, and were then given work to complete at a desk in a simulated work environment. One group was assigned an easy, low-stress task, while the other was asked to complete a more demanding job. The other two groups were asked to rest, rather than go for a walk, before being given those same work tasks.

A bowl of chocolates was placed within the reach of all participants as they carried out their work.

The researchers found that the people who had gone for a walk ate, on average, about 15 grams (0.5 ounces) of chocolate, or the equivalent of a small "fun size" chocolate bar, while the resting group ate about 28 grams (0.9 oz).

The results also showed that the difficulty of the tasks made no difference in the amount of chocolate they ate, which suggests that stress did not contribute to their chocolate cravings, according to the researchers.

"We often feel that these snacks give us an energy boost, or help us deal with the stress of our jobs, including boredom," Taylor said. "People often find it difficult to cut down on their daily treats, but this study shows that by taking a short walk, they are able to regulate their intake by half."

The study will be published in the February issue of the journal Appetite.

Pass it on: Taking a 15-minute stroll can cut snacking on chocolate at work by nearly half.