circuitpython/tests/bench/funcall-1-inline.py
Paul Sokolovsky e53d2197e4 bench: Add test for function call overhead.
For a trivial operation, calling a function is 5 times slower than doing
operation inline.
2014-06-19 20:49:03 +03:00

10 lines
190 B
Python

# Function call overhead test
# Establish a baseline for performing a trivial operation inline
import bench
def test(num):
for i in iter(range(num)):
a = i + 1
bench.run(test)