Benchmark simple sequential loop performance
(num_tests)
| 15 | |
| 16 | # ---------------------- Sequential Execution ---------------------- |
| 17 | def test_sequential_exec(num_tests): |
| 18 | """Benchmark simple sequential loop performance""" |
| 19 | total_ops = 0 |
| 20 | for _ in range(num_tests): |
| 21 | counter = 0 |
| 22 | start_time = runtime_time() |
| 23 | # Count how many iterations can be done within 1000 microseconds |
| 24 | while runtime_time() - start_time < 1000: |
| 25 | counter += 1 |
| 26 | total_ops += counter |
| 27 | return int(total_ops / num_tests) |
| 28 | |
| 29 | |
| 30 | # ---------------------- Function Call Performance ---------------------- |
no test coverage detected