标签:pen image 多进程 def round 技术分享 idt width 进程
from time import ctime,sleep,time
import multiprocessing
def super_play(file_, t):
for i in range(2):
print("Start playding: %s! %s"% (file_,ctime()))
sleep(t)
lists={"天边.mp3":3,"廊桥遗梦.rmvb":5,"壮志凌云。avi":4}
lists_len = range(len(lists))
threads = []
for file,t in lists.items():
p = multiprocessing.Process(target=super_play,args=(file,t))
threads.append(p)
if __name__=="__main__":
start = time()
for i in lists_len:
threads[i].start()
for i in lists_len:
threads[i].join()
end = time()
ge = round((end-start),1)
print("共耗时%s秒"%ge)
参照廖雪峰和菜鸟教程,
标签:pen image 多进程 def round 技术分享 idt width 进程
原文地址:https://www.cnblogs.com/csj2018/p/10055324.html