Skip to content

Commit a814b74

Browse files
authored
adjust python perf-test script
1 parent 0453809 commit a814b74

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/spectator/lang/py/perf-test.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ def elapsed():
3131

3232
print(f"start spectator-py {location} benchmark")
3333
iteration = 1
34-
while True:
34+
while elapsed() < max_duration:
3535
registry.counter("spectator-py.publish", tags).increment()
3636
if iteration % 500000 == 0:
3737
print(f"iterations={iteration} elapsed={elapsed():.2f}")
38-
if elapsed() > max_duration:
39-
break
4038
iteration += 1
4139

42-
print(f"iterations={iteration} rate/sec={iteration/elapsed():.2f}")
40+
print(f"iterations={iteration} elapsed={elapsed():.2f} rate/sec={iteration/elapsed():.2f}")
4341
```
4442

4543
## Results

0 commit comments

Comments
 (0)