1.调用系统当前时间 perf_counter()
import time as t start = t.perf_counter() end = t.perf_counter() tim=end-start print('运行这段代码用时:{:.6f}'.format(tim)
2.系统暂停
time.sleep(0.1)
1.调用系统当前时间 perf_counter()
import time as t start = t.perf_counter() end = t.perf_counter() tim=end-start print('运行这段代码用时:{:.6f}'.format(tim)
2.系统暂停
time.sleep(0.1)