发布时间:2019-09-09 08:48:40编辑:auto阅读(3551)
使用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从下载链接下载文件到本地
54157
40918
35440
31062
25960
25693
24142
19687
15744
15210
1979°
1825°
1905°
2002°
1987°
2170°
2126°
1943°
2017°
2009°