import math import timeit def f(comb, repeat): for _ in range(repeat): comb(67, 0) comb(67, 1) comb(67, 2) comb(67, 3) comb(67, 4) comb(67, 5) comb(67, 6) comb(67, 7) comb(67, 8) comb(67, 9) comb(67, 10) comb(67, 11) comb(67, 12) comb(67, 13) comb(67, 14) comb(67, 15) comb(67, 16) comb(67, 17) comb(67, 18) comb(67, 19) comb(67, 20) comb(67, 21) comb(67, 22) comb(67, 23) comb(67, 24) comb(67, 25) comb(67, 26) comb(67, 27) comb(67, 28) comb(67, 29) comb(67, 30) comb(67, 31) comb(67, 32) comb(67, 33) comb(67, 34) comb(67, 35) comb(67, 36) comb(67, 37) comb(67, 38) comb(67, 39) comb(67, 40) comb(67, 41) comb(67, 42) comb(67, 43) comb(67, 44) comb(67, 45) comb(67, 46) comb(67, 47) comb(67, 48) comb(67, 49) comb(67, 50) comb(67, 51) comb(67, 52) comb(67, 53) comb(67, 54) comb(67, 55) comb(67, 56) comb(67, 57) comb(67, 58) comb(67, 59) comb(67, 60) comb(67, 61) comb(67, 62) comb(67, 63) comb(67, 64) comb(67, 65) comb(67, 66) comb(67, 67) repeat = 1024 number = 256 time = timeit.timeit(f'f(math.comb, {repeat})', number=number, globals=globals()) # Approximate time to execute one comb(67, k) call, in nanoseconds. print(time / (68*number*repeat) * 1e9)