当前位置 : 主页 > 编程语言 > python >

Python之时间统计

来源:互联网 收集:自由互联 发布时间:2022-07-17
1.秒级 import time startTime = time.time() endTime = time.time() print 2.微秒级 from datetime import datetime start_ = datetime.utcnow() end_ = datetime.utcnow() c = (end_ - start_) print c.seconds print 黄世宇/Shiyu Huang's Persona

1.秒级

import time
startTime = time.time()
endTime = time.time()
print

 

 

2.微秒级

from datetime import datetime

start_ = datetime.utcnow()
end_ = datetime.utcnow()
c = (end_ - start_)
print c.seconds
print

 

黄世宇/Shiyu Huang's Personal Page:​​https://huangshiyu13.github.io/​​



上一篇:Python之两个列表一起打乱
下一篇:没有了
网友评论