 PyMuPDF 1.24.2 Documentationimport time from multiprocessing import Pool, cpu_count import fitz # choose a version specific timer function (bytes == str in Python 2) mytime = time.clock if str is bytes else time.perf_counter def numbers %i through %i" % (seg_from, seg_to - 1)) if __name__ == "__main__": t0 = mytime() # start a timer filename = sys.argv[1] mat = fitz.Matrix(0.2, 0.2) # the rendering matrix: scale down to 20% cpu pool.map(render_page, vectors, 1) # start processes passing each a vector t1 = mytime() # stop the timer print("Total time %g seconds" % round(t1 - t0, 2)) Here is a more complex example involving inter-process0 码力 | 565 页 | 6.84 MB | 1 年前3 PyMuPDF 1.24.2 Documentationimport time from multiprocessing import Pool, cpu_count import fitz # choose a version specific timer function (bytes == str in Python 2) mytime = time.clock if str is bytes else time.perf_counter def numbers %i through %i" % (seg_from, seg_to - 1)) if __name__ == "__main__": t0 = mytime() # start a timer filename = sys.argv[1] mat = fitz.Matrix(0.2, 0.2) # the rendering matrix: scale down to 20% cpu pool.map(render_page, vectors, 1) # start processes passing each a vector t1 = mytime() # stop the timer print("Total time %g seconds" % round(t1 - t0, 2)) Here is a more complex example involving inter-process0 码力 | 565 页 | 6.84 MB | 1 年前3
共 1 条
- 1
相关搜索词













