import _testinternalcapi import pyperf runner = pyperf.Runner() func = _testinternalcapi.noop # builtins.id() is declared with METH_NOARGS calling convention runner.bench_time_func("bench", _testinternalcapi.test_bench_public, func)