python 基础 | 实现微秒级计时
搬运一个计时代码:
import datetime
s = datetime.datetime.now() # 开始
# do something
e = datetime.datetime.now() # 结束
print("程序运行时间:", (e - s).microseconds, "微秒")
搬运一个计时代码:
import datetime
s = datetime.datetime.now() # 开始
# do something
e = datetime.datetime.now() # 结束
print("程序运行时间:", (e - s).microseconds, "微秒")