real time yarn stock to which a quantity of 200 mm drum development must be added for each motor revolution this is shown in the following table from the previously given examples it is apparent that the unit 35 is able to measure with absolute precision the value of the stock of yarn f and the yarn quantity absorbed ayl by the textile machine it should be noted that the resolution of the two measurements can be improved for example the number of optical barriers can be incremented such as to reduce the minimum increment and decrement step calculated as the drum development divided by the number of barriers an encoder can be used to know the exact position of the motor 6 and hence of the drum 5 such that the contribution given by the rotation of the motor 6 in the calculation of the fed yarn quantity is not an exact multiple of the drum development but a function of its position hence also taking account of the fractions of a revolution with greater encoder resolution and greater measurement resolution for example by using a 4096 position encoder precisions can be achieved which are less than one tenth of a millimetre one of the possible embodiments of the invention has been described others are however possible in the light of the preceding description for example the number of barriers could be greater or less than four odd or even and comprise at least one pair of emitters and at least one pair of receivers obviously as the number of barriers increases the counting precision varies as already indicated moreover the barriers.