The invention relates to a peritoneal dialysis machine for the carrying out of a peritoneal dialysis treatment having recurring cycles, the cycles comprising an inflow phase, a dwell period, and a drainage phase for the dialysis fluid, wherein the machine has a control unit and a measurement apparatus for determining the inflow behavior and/or drainage behavior of the dialysis fluid to and from a patient, wherein the control unit is configured to determine a time delay factor on the basis of the measured values collected over a plurality of inflow phases and/or drainage phases, said time delay factor putting a theoretical inflow duration and/or drainage duration into relation with the actual inflow duration and/or drainage duration of dialysis fluid to or from the patient.