A method for controlling a processor to detect a hypopnea is disclosed. The processor receives a measured flow of breathable gas and a long-term measure of ventilation based on the measured flow of breathable gas id determined. A short-term measure of ventilation based on the measured flow of breathable gas and a threshold as a proportion of the long-term measure of ventilation are determined. An area bounded by first and second crossings of the short-term measure of ventilation and the threshold is measured and the hypopnea is detected based on an extent of the measured area.