1.datetime显示当前时间
import datetimeimport timedef func(): t = datetime.datetime.now() print t print "start **************" l=[] for i in range(1, 10): l.append(i) time.sleep(1) e = datetime.datetime.now() print e print (e - t).secondsfunc()