The third stage of a caterpillar’s life is the chrysalis, and it can vary from weeks to months or even years. The monarch butterfly lays dormant inside it’s chrysalis for approximately 2 weeks before coming out, while the anise swallowtail can take years to emerge.
Although it's a common misconception, caterpillars do not spin a cocoon. Instead they make a chrysalis or a pupa, which is mostly brown or green so it will blend in with its surroundings while the butterfly develops inside. As the butterfly changes, the chrysalis will also change its shape. After the butterfly emerges, its wings are slightly moist, and it is tired from struggling free from the pupa.