The time it takes to get rid of a fruit fly infestation depends on the severity of the infestation and the methods used to eliminate it. In general, it can take anywhere from a few days to a few weeks to completely eliminate a fruit fly infestation. It is important to be patient and persistent in your efforts to eliminate the infestation, as fruit flies can be difficult to get rid of.