import pyperf import _testcapi runner = pyperf.Runner() runner.bench_time_func('bench_bytes_api', _testcapi.bench_bytes_api)