1from time import perf_counter as timer
2import time
3from ctypes import windll #new
4
5timeBeginPeriod = windll.winmm.timeBeginPeriod #new
6timeBeginPeriod(1) #new
7
8start = timer()
9for i in range(1000):
10 print (i)
11 time.sleep(0.001)
12
13end = timer()
14print ("Total time: ", end - start)
15