Skip to content

Commit 28148ed

Browse files
Use polling
1 parent 3d56992 commit 28148ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pyperformance/data-files/benchmarks/bm_fastapi/run_benchmark.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def bench_fastapi(loops):
5555

5656
async def run_benchmark():
5757
server_task = asyncio.create_task(server.serve())
58-
await asyncio.sleep(0.5)
58+
while not server.started:
59+
await asyncio.sleep(0.01)
5960

6061
async with httpx.AsyncClient() as client:
6162
t0 = pyperf.perf_counter()

0 commit comments

Comments
 (0)