Vomiting from viral gastroenteritis or food poisoning generally lasts 24-48 hours but can persist 2-3 days before resolving.