import time t = 0 for _ in range(1000): a = time.time() time.sleep(1e-7) b = time.time() t = t + (b-a) print("average: ", t / 1000)