idx = 0
start_time = time.time()
while True:
idx += 1
time.sleep(0.01)
if idx > 100:
break
print(time.time() - start_time)
Normally, This code have to take 1 second (100 * 0.01) to run. But if I run, it takes about 1.57 seconds. So, I want to more correct timer with millisecond unit. Please help me.