(num_tests, length)
| 135 | |
| 136 | |
| 137 | def test_string_ops(num_tests, length): |
| 138 | total_ops = 0 |
| 139 | pool = [rand_bytes(length) for _ in range(100)] # pre-generated pool |
| 140 | for _ in range(num_tests): |
| 141 | counter = 0 |
| 142 | start_time = runtime_time() |
| 143 | while runtime_time() - start_time < 1000: |
| 144 | s = pool[random.randint(0, 99)] + pool[random.randint(0, 99)] |
| 145 | counter += 1 |
| 146 | total_ops += counter |
| 147 | return int(total_ops / num_tests) |
| 148 | |
| 149 | |
| 150 | # ---------------------- Array Random Access ---------------------- |
no test coverage detected