import ElementTree as ET import time for i in range(5): t0 = time.time() ET.parse("hamlet.xml") print time.time() - t0