def main_loop():
while True:
profiling = True
# profiling = False
if not profiling:
main()
else:
currpath = 'stats\mybot-currturn.stats'
lastpath = 'stats\mybot-lastturn.stats'
if os.path.exists(currpath):
if os.path.exists(lastpath):
os.remove(lastpath)
os.rename(currpath, lastpath)
cProfile.run('main()', currpath)
# if "pypy" not in sys.executable:
# else:
# with open(currpath, "w") as f:
# vmprof.enable(f.fileno(), period=0.00099, memory=False)
# main()
# vmprof.disable()
#cProfile.run('main_loop()', 'stats\mybot.stats')
评论列表
文章目录