import sum import numpy x = numpy.arange(10000000) %time sum.sum_function(x) CPU times: user 2.15 s, sys: 68.4 ms, total: 2.22 s Wall time: 2.22 s