The invention relates to a method of carrying out, in a line, (4; 6, 23)measurements on a medium, especially constituted by a gas and/or a liquid,flowing - in particular in a pulsating current - through said line, which line(4; 6, 23) comprises a measuring region (17; 23) in which at least oneparameter of the medium is determined during a measurement, so that there isdefined an optimal measuring window in which the parameter is measured and thedata from the measuring window are recorded and/or used for a further process.