In order to improve the accuracy of gas flowrate measurement by means of the differential pressure flowmeters, it is necessary to apply equations for determination of coefficients of gas flow equation, which would provide the lowest total relative expanded uncertainty of calculation, and to increase the accuracy of input values measurement in real time. One of these values is the arithmetic mean deviation of roughness profile of pipe internal surface. The equation for calculating the arithmetic mean deviation of roughness profile of pipe internal surface in real time was obtained. The equation for calculating the total relative expanded uncertainty of measurement result of arithmetic mean deviation of roughness profile of pipe internal surface in real time and components of this uncertainty were obtained.