1、python 打印时间
import time
print('my name:%s'%time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
print('my name2:%s'%time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()))
from time import strftime, localtime
# 打印当前时间
def printTime():
print(strftime("%Y-%m-%d %H:%M:%S", localtime()))
return
2、程序运行时间
import time
import datetime
#print('my name:%s'%time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
#print('my name2:%s'%time.strftime("%a %b %d %H:%M:%S %Y", time.localtime()))
def run_fun(num):
i=0
cycle = 10000000*num
while i
https://edu.csdn.net/topic/python115?utm_source=blogt3two



