There is provided a computer-implemented method for calculating a gastric emptying rate from a stomach lumen into a small intestine of a patient, comprising: using at least one processor for executing the following during an enteral tube feeding of a stomach of the patient by a feeding mechanism: analyzing outputs of at least one stomach sensor located within the stomach for detecting a stop feeding condition; pausing the enteral tube feeding in response to a detection of the stop feeding condition; after a predefined period of time, restarting the enteral tube feeding until the stop condition is redetected by an analysis of said outputs; calculating a gastric emptying rate based on an amount of feeding content delivered during a period between the restarting and the redetection; and instructing the feeding mechanism to adapt a feeding rate of the enteral tube feeding according to the gastric emptying rate.