计算用时 import timeit start = timeit.default_timer() # program end = timeit.default_timer() print(f'used time : {end - start}s') 计算内存 conda install memory_profiler #On command line mprof run script.py #To generate plot mprof plot *.dat