process_usage.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:base_function 作者: Rockyzsu 项目源码 文件源码
def pool_map():
    x=[i for i in range (50) if i%2==0]
    #print x

    start=time.time()
    '''
    for i in x:
        single(i)
    print "time used " , time.time()-start
    '''
    #using multiprocess
    p=Pool(2)
    s=p.map(single,x)
    p.close()
    p.join()
    print s
    print len(s)
    print "end. Time used: ",time.time()-start
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号