Measurement of the thickness of thin foils