circuitpython/tests/bench/func_args-2-pos_default_2_of_3.py
Paul Sokolovsky 2a05f05f44 tests/bench: Add tests for various ways to pass function args.
Passing 3 args with keywords is for example 50% slower than via positional
args.
2014-05-07 22:34:04 +03:00

11 lines
126 B
Python

import bench
def func(a, b=1, c=2):
pass
def test(num):
for i in iter(range(num)):
func(i)
bench.run(test)