import ctypes
import re
import time, datetime
import sre_parse
try:
CGJ = ctypes.CDLL("F:\\go\\src\\pythondy\\s1.so") # 加载s1.so工具文件
CGJ.tiqu_zifu.restype = ctypes.c_char_p
CGJ.beijing_shijian2.restype = ctypes.c_char_p
# CGJ.beijing_shijian.restype = ctypes.c_int32 # 无用可以自接调用
except:
print("加载go模块失败")
def lunxun_cs():
threads = []
manzufou = [False, False, False, False, False]
def main8():
"""用cProfile分析代码运行时间"""
t = time.time()
for i in range(10000*10000):
# int(time.strftime('%H%M%S')) # 10000*100 1.821
# time.strftime('%H:%M:%S') # 10000*100 1.831
# datetime.datetime.now().strftime('%H:%M:%S') # 10000*100 3.89
# CGJ.beijing_shijian() # 1.52
# CGJ.beijing_shijian2().decode("utf-8") # 10000*100 2.024
# if "12:00:08" != "12:00:07": # 10000*100 0.35
# ...
# if float(0.55) != 0.55: #10000*100 0.80
# ...
# if 1: # 10000*10000 1.5
# ...
# if True: # 10000*10000 1.48
# ...
# if 5>6: # 10000*10000 2.8
# ...
# if 5 >= 6: # 10000*10000 2.8
# ...
# if "10:15:23" != "10:55:66": # 10000*10000 3.255
# ...
# if 105530 != 105545: # 10000*10000 2.937
# ...
# manzufou = []
# if "10:15:23" != "10:55:66": # 10000*10000 16.55
# manzufou.append(False)
# manzufou = [False, False, False, False, False]
# if "10:15:23" != "10:15:66": # 10000*10000 9.197
# manzufou[0] = True
# if isinstance('k', float): # 10000*10000 14.38
# ...
if type(5.6655) == float: # 10000*10000 8.15
...
print('所用时长=', time.time()-t)
if __name__ == '__main__':
import cProfile
# print((CGJ.beijing_shijian2()).decode("utf-8"))
# print(datetime.datetime.now().strftime('%H:%M:%S'))
cProfile.run('main8()', sort='time')
import sre_parse