def execute_codes(kernel_ids, parallel=False):
times_taken = []
if parallel:
pool = multiprocessing.Pool(len(kernel_ids))
results = pool.map(run_execute_code, kernel_ids)
for t in results:
if t is not None:
times_taken.append(t)
else:
for kid in kernel_ids:
t = run_execute_code(kid)
if t is not None:
times_taken.append(t)
print_stat('execute_code', times_taken)
评论列表
文章目录