Before I do any strenuous workout, like running or swimming, I make sure I eat at least 2 hours before that to fuel my body and prepare it for the workout. Some people can manage an hour before the workout, but not me. I'll definitely regurgitate whatever I ate. I learned that while doing the warm up exercises for Tai Chi class some years ago. Good thing I was able to hold the food in or it would have been such a mess, not to mention very embarrassing.
After our Tai Chi classes, our coach would tell us to eat at least within an hour after our class and include protein sources. After long runs, nobody has to remind me to eat. My stomach would definitely be begging for food. Some people would scoff at me when I tell them I eat after my runs. They say that defeats the purpose of exercising if I just eat. Really? That is where they are wrong. Nevertheless, I listen to what my body tells me. And this infographic below tells me I'm doing the right thing, but I have to pay attention to what I eat, the protein and carbohydrate balance and all that.
Use this as a guide when you do your workouts.