Nov-17-2018, 05:10 PM
Hi, I have a function that I execute with no problems with multiprocessing however I cant time it
If I change it to use timeit.timeit I get: TypeError: 'float' object is not callable
Can you point me to what I am doing wrong?
import multiprocessing as mp import timeit poolTimes = mp.Pool(processes=5) poolResults = mp.Poool(processes=5) results = [poolResults.apply(myLibrary.myFunction, args=(myObject,)) for myObject in listMyObjects] times= [poolTimes.apply(timeit.Timer(lambda: myLibrary.myFunction), args=(myObject,)) for my Object in listMyObjects]With that code I get: _pickle.PicklingError: Can't pickle attribute lookup inner on timeit failed
If I change it to use timeit.timeit I get: TypeError: 'float' object is not callable
Can you point me to what I am doing wrong?