In lung function diagnostics and lung function monitoring flow velocity F and gas concentrations f x of the gases flowing in and out of the patient's lungs have to be measured synchronously, i.e. without a time-delay between F and f x . In many cases, however, the gas concentration is measured using side-stream sensors and a time-delay is caused by the gas travelling from the main-stream flow sensor to the side-stream gas sensor and by the response time of the gas sensor itself. For data analysis the time-delay between main-stream and side-stream sensors must be compensated. The method of the present invention determines the time-delay by use of the molar mass signal of a main-stream flow- and molar mass sensor. The time-delay is measured by correlating the signals of the main-stream molar mass and the side-stream gas analyzer signal.