如何在python中比较微秒时间差(mi

2023-01-31 03:01:22 时间差 如何在 微秒
import time
from datetime import datetime

start = round(time.time()*1000)
print start

start_ = datetime.utcnow()
print start_

time.sleep(1)

end = round(time.time()*1000)
print end

end_ = datetime.utcnow()
print end_

c = (end_ - start_)
print c.seconds  
print c.microseconds 
print c
print c/2



 

相关文章