Closed idiomaticrefactoring closed 2 years ago
Look again at the signature of timeit:
>>> import pyperf
>>> help(pyperf.Runner.timeit)
Help on function timeit in module pyperf._runner:
timeit(self, name, stmt=None, setup='pass', teardown='pass', inner_loops=None, duplicate=None, metadata=None, globals=None)
First is name
. You can't have a name with newlines. You can have a stmt
with newlines.
Right. You misused the timeit(name, stmt, ...) API. I close the issue.
It occurs errors:
ValueError: newline characters are not allowed in metadata values: 'for i in range(10):\n t.append(i)'
Someone knows how to record time for multiple statements?