The lifespan of a housefly in a suitable indoor environment varies between 15 and 30 days.