import pyperf import _testcapi runner = pyperf.Runner() runner.bench_time_func('fromid a', _testcapi.bench_fromid1, inner_loops=10) runner.bench_time_func('fromid abc', _testcapi.bench_fromid2, inner_loops=10)