A device (100) for measuring the consumption of oxygen and the elimination of carbon dioxide by a subject comprises an air collecting member (2) for collecting the flow of air breathed, a flowmeter (4) for measuring the flow rate of air exhaled by the subject, and a sampling line (8) for sampling a portion of the flow of air exhaled by the subject. A pump (11), with substantially constant capacity draws the aforesaid portion of flow of air into the sampling line (8). A mixing chamber (18) is interposed in the sampling line (8) for collecting and mixing together flows of air exhaled by the subject in a number of breathing cycles. Means for sensing the concentration of oxygen (12) and means for sensing the concentration of carbon dioxide (14) are arranged in the sampling line (8). The pump is with constant capacity, but is controlled in a PWM mode in order to simulate a capacity that varies in proportion to the variation of the flow during the breathing cycle so as to render measurement of the consumption of oxygen reliable even though the mixing chamber (18) does not receive the entire flow exhaled by the subject. The device further comprises a bypass line (28) of the mixing chamber (18), through which the flow of air can pass without passing through the mixing chamber (18). A valve (30) for selecting the measuring mode can be displaced selectively into two different positions, to get the flow of air that traverses the sampling line (8) to converge either through the mixing chamber (18), when an average measurement is to be made of the consumption of oxygen by the subject in the course of a number of breathing cycles, or through said bypass line (28), when an instantaneous measurement is to be made of the consumption of oxygen by the subject in each breathing cycle.