#!/usr/bin/env python3 import perf import time runner = perf.Runner() numbers = ( '1.', '2.**20', '2.**30', '2.**60', '-2.**63', '2.**80', '2.**120', ) funcs = ( 'int', 'math.ceil', 'math.floor', ) for func in funcs: for n in numbers: name = f'{func}({n})' runner.timeit( name, setup=f'import math; f = {func}', stmt=f'f({n})', duplicate=100, )