Before you exercise, eat carbs, but not too much, said Nancy Cohen, a professor in the department of nutrition at the University of Massachusetts in Amherst.
She recommended consuming 1 to 4 grams of carbohydrates per every 2.2 pounds of body weight if you are planning to exercise for longer than an hour. To put that in perspective, a medium banana has about 27 grams of total carbohydrates.
The Dietary Guidelines for Americans recommends that if you get 2,000 calories a day, aim to consume between 225 and 325 grams of carbohydrates, according to the Mayo Clinic.
When should you eat? About an hour to four hours before working out, Cohen said.
A review paper by researchers at the University of Sydney in Australia suggests that carbohydrate ingestion can improve endurance exercise performance. The paper was published in the Journal of Nutrition in 2011.
The researchers assessed 50 previous single- or double-blind, randomized studies on carbohydrate ingestion and endurance exercise. The researchers concluded that the data in the studies provide evidence that consuming carbohydrates can enhance endurance exercise performance in adults.
Research on how quality carbs can influence exercise performance -- especially endurance exercise -- dates to the 1930s.
"By eating carbohydrate-rich foods that are low in fat and low or moderate in protein, you can make sure you have enough muscle glycogen as fuel for your physical activity. This might include low-fat granola bars, fig bars, a peanut butter and jelly sandwich, banana, yogurt, pasta or other high-carbohydrate foods," Cohen said.
"Sufficient fluids are also important," she said. "In general, you can consume 5 to 10 milliliters of water per kilogram of body weight in the two to four hours before a workout."
If you prefer to break a sweat in the morning, experts are divided on whether you should eat ahead of time.
It should be your own decision on whether to eat breakfast before or after exercise, said Stuart Phillips, professor at McMaster University in Canada and director of the McMaster Center for Nutrition, Exercise, and Health Research.
"I work out before breakfast every day because that's when I like to work out. I don't take in anything other than perhaps a cup of coffee most times or perhaps a slice of toast. My big breakfast comes after. But that's not to say that's good or bad. That's just what I do," Phillips said.
What to eat during exercise
One of the most important things to do during exercise is hydrate -- and if your workout is 45 minutes or less, fluids may be all you need to keep you going, Cohen said.
"For endurance exercises of one to 2½ hours, aim for 30 to 60 grams of carbohydrates per hour. This will provide carbohydrates to fuel the exercise to supplement the muscle glycogen," Cohen said. For instance, a medium apple has about 25 grams of total carbohydrates.
"Depending on the sport and the comfort of the individual, a range of foods or beverages could be useful here," she added. "Juices, sports drinks, granola bars, fruit and other high-carbohydrate foods and drinks can be helpful."
Phillips agreed, saying liquids are more easily digested.
"Solid food sits in your stomach, and for many people, that creates discomfort. So, mostly liquid," he recommended.
What to eat after exercise
After you exercise, munch on protein, Cohen said, such as dairy products, eggs, meat and poultry.