A device for measuring oxygen uptake and carbon dioxide production by a respiring subject based on the use of absorption spectroscopy. An absorption spectrometer using cavity enhanced absorption spectroscopy at 763 nm to measure oxygen concentration and direct absorption or wavelength modulation spectroscopy at 2.0035 μm for carbon dioxide concentration is incorporated into a breathing tube in proximity to the respiring subject. This provides measurements of oxygen and carbon dioxide concentration with a good temporal resolution which can be combined with measurements of flow rate as a function of time to obtain oxygen uptake and carbon dioxide production on a breath-by-breath basis. The device can also measure the concentration of water vapor and of anaesthetic gases in exhaled breath.