It happens like a bolt out of the blue. One minute you're fine, and the next you begin to sweat as crippling cramps move wave-like through your belly. You vomit or have diarrhoea, or both, fearing you won't live to see another day.
And then it goes away. You're back to your old self, maybe after a day or two of binge-watching Netflix and chasing dry crackers with ginger ale.
The United States Centres for Disease Control and Prevention (CDC) estimates that this scenario, known as an "acute gastrointestinal event", happens to all of us at least once a year. The bouts, while extremely unpleasant, usually do not occasion a trip to the doctor or require any medication.
But such events tend to make us spin our gears trying to pinpoint what made us so miserably sick. While it is hard to know for sure, there are clues that might help you determine the source and reduce your risk in the future.
"People tend to blame the last thing they ate, but it's probably the thing before the last thing they ate," said Dr Deborah Fisher, a gastroenterologist and associate professor at Duke University School of Medicine.
It takes the stomach around four to six hours to empty a full meal, and then the small intestine takes about six to eight hours to squeeze out all the nutrients and empty into the colon. The remains linger there for another one to three days, fermenting and being formed into what ultimately is flushed down the toilet.
So-called bowel transit time varies significantly from person to person, but gastroenterologists said you can easily find out what's normal for you by eating corn and watching for when the indigestible kernels appear in your stool.
Gross, perhaps, but with that baseline, the next time you get sick, you will be better able to estimate when you might have eaten the offending meal. For example, if you throw up something and do not have diarrhoea or roiling further down, it could be that what made you ill was something you ate within the last four to six hours. If you wake up in the middle of the night with cramps and diarrhoea, it's more likely something you consumed a good 18 to 48 hours earlier, depending on the results of your corn test.
Most food-borne illnesses are caused by viruses or bacteria, such as norovirus, Staphylococcus aureus, campylobacter, salmonella, E. coli and Bacillus cereus.
So in addition to figuring out the correct timeframe of consumption, also consider what foods are more likely to be contaminated. Items cited by the CDC and frequently on the US Food and Drug Administration's food recall list include leafy greens, culinary herbs, melons with textured surfaces like cantaloupe, fresh tomatoes, cucumbers, jalapeno peppers, nut butters, shellfish, frozen peas, cheese and ice cream. Also suspicious are foods left out for several hours, like the classic potato salad at the family picnic.
Restaurant food tends to be riskier in general not only because more hands are involved in the preparation but also because the ingredients are ordered in bulk.
"A fast-food hamburger could have meat from 100 different cows," Dr Fisher said, and it takes only one with a pathogen to make you sick. "The eggs in your two-egg omelette were poured out of a carton, so it could have come from 50 different chickens," she said.
Similarly suspect are freshly made juices and smoothies which are extracted from pounds of produce. Just one speck of contaminated dirt in your detox drink could upend your gut. And think of all the hands that necessarily touched the produce from the time it was picked in the field to when it was chopped and crammed into the Vitamix.
Let us not forget about germs on your own hands if you are not diligent about washing them with soap and water (hand sanitisers do not kill some of the bugs that make your stomach sick). Did you eat or otherwise put your fingers in your mouth after gripping the pole on the subway or after throwing a slobbery ball for your dog? Did you put your mobile phone down on the table at a coffee shop - or on top of the toilet-paper dispenser in a public restroom - and then put it up to your mouth to take a call? Germs that make it into your digestive tract do not always come from food.
And sometimes your gut distress is not caused by a germ at all. It could be an overdose of fermentable oligosaccharides, disaccharides, monosaccharides and polyols, known in public health circles as Fodmaps. These are essentially carbohydrates that, eaten in excess, are not well absorbed in the small intestine and then make their way into your colon to cause all kinds of trouble. They include myriad things we are encouraged to eat, including broccoli, brussels sprouts, radicchio, asparagus, avocados, mushrooms, peaches, whole grains and legumes.
"People are trying to eat so healthily these days, but a lot of those things are high in Fodmaps," said Dr Scott Gabbard, a gastroenterologist at the Cleveland Clinic. "You could always eat a lot of salad, but on that certain day, that certain combination of fruit and vegetables in your salad was just high enough in Fodmaps that it overrode your system's capability to absorb those carbohydrates and you ended up with something almost like a purging."
Drugs are also a common source of acute gastrointestinal events. Dr Fisher told the story of an otherwise-healthy and active patient who had bouts of GI distress every few months or so. After many tests came back negative, she finally determined it was the ACE inhibitor he was taking to control his blood pressure.
"A side effect of the drug is that it causes swelling in the intestines so he would get these temporary, partial obstructions," Dr Fisher said. "He would vomit and skip a meal and then the swelling would go down. It went on and on until we took him off that drug and now he's fine."
Medications used to treat depression, allergies and gastrointestinal reflux can also make you more vulnerable to intense, short-duration attacks of vomiting or diarrhoea, or both. Recreational drugs could also be the culprit.
Finally, there is stress. What is going on in your head has an enormous impact on your gut and vice versa. "The human brain and nervous system are very intimately mixed with another nervous system that is present in the walls of the intestine," said Dr Santhi Swaroop Vege, a gastroenterologist at the Mayo Clinic. "These nerve fibres, nerves and plexuses are located continuously in the wall of the intestine, from the oesophagus to rectum."
So instead of something that you ate, it could be you have swallowed your fear, anxiety, anger or sadness and it is wreaking havoc on the nerves, chemical secretions and microbiota that keep your bowels operating smoothly.
Gastroenterologists as well as psychiatrists said it is not uncommon for acute gastrointestinal events to cease or become less frequent after a patient quits a bad job or leaves a bad relationship. That is why, when making a difficult decision, you might just want to trust your gut.