Many illnesses that cause nausea and vomiting are not contracted from eating something bad (the vast majority in fact). You may have touched a door knob that someone that was sick also touched and then you use that hand to eat food and spread the illness to yourself. In that instance, you would get sick just as if you contracted food poisoning but it was actually from something that was spread by your own hand. The timing of the vomiting does not tell you anything about whether the food was contaminated or not.