发布时间:2019-09-09 08:48:40编辑:auto阅读(2999)
使用python中的datetime
import datetime
oldtime=datetime.datetime.now()
print oldtime;
x=1
while x<10000000:
x=x+1
newtime=datetime.datetime.now()
print newtime;
print u'相差:%s'%(newtime-oldtime)
print u'相差:%s微秒'%(newtime-oldtime).microseconds
print u'相差:%s秒'%(newtime-oldtime).seconds
上一篇: python转换维度
下一篇: python从下载链接下载文件到本地
51001
50385
40999
37868
32332
29227
28108
22941
22906
21236
1099°
1792°
1460°
1400°
1676°
1481°
2142°
3701°
3635°
2555°