"""NOTE: If running on Windows you need to run this from the command lines using: python parallel_processing_examples.py Not from inside Wing """ from multiprocessing import Pool, freeze_support import time import numpy as np def takeuptime(ntrials): np.random.seed() junk = 0 for ii in xrange(ntrials): junk += np.std(np.random.randn(1e5)) return junk if __name__ == "__main__": start = time.time() pool = Pool() result = pool.map(takeuptime, [100, 100, 100, 100]) print "Parallel time: %f" % (time.time() - start) print "The output is: %s" % result