Fleas go through four life cycle stages: egg, larvae, pupae, and adult. An adult flea, after finding a blood meal, will seek out a mate then lay eggs, often in a shady, moist area. The eggs hatch in one to ten days (faster in warm, humid conditions). After five to 20 days the larvae enter the pupal stage by weaving cocoons. The fleas are largely immune to insecticides for days or weeks until the adult fleas are ready to emerge from the cocoons. The adult fleas do not emerge until they sense nearby movement or body heat, indicating a blood meal is available in the area. Upon hatching, the adult females latch onto a warm-blooded host to secure a meal—this is the time when pets often pick up outdoor fleas and bring them indoors. After feeding, the adult fleas seek mates and begin a new cycle. An entire generation can be completed in a matter of days when conditions are favorable, but it can take years if no blood host is immediately available.