Why do Flamingos Stand on One Leg?

I used to just think those long legs of theirs just got tired and they needed to give each leg a rest. Two possible reasons are to allow their webbed feet to dry out and not get to pruned. Another reason is to conserve body heat and energy.