A method for animal management is provided in a milking system comprising
a milking box (13), a milking apparatus (13d) for milking animals (10),
an enclosed waiting area (14) from which the animals are capable of
entering the milking box, and a gate arrangement (14a), through which
each of the animals is allowed to pass to enter the waiting area if the
animal, after having been identified, fulfills a criterion. The method
comprises the steps of measuring (21) a time an animal waits in the
waiting area before being milked; determining (22) a rank number for the
animal based on the time, the rank number being a measure of the
hierarchic order of the animal among the animals milked in the milking
system; and performing (23) an action with regard to the milking system
depending on the determined rank number.