Will It Vibe logoWill It Vibe?
PERF-015Low severity-4 points

time.sleep() in a file that also uses async/await

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

time.sleep() blocks the entire thread, so if it runs on the asyncio event loop it stalls every other coroutine for its duration, not just the caller. asyncio.sleep() yields control back to the loop instead. Heuristic: this only checks that the same file defines an async def and uses await somewhere else, not that this exact call sits inside a coroutine.

Why it matters

time.sleep() blocks the entire operating-system thread it runs on, not just the current function. If that thread is the one running your asyncio event loop, every other coroutine scheduled on that loop is stuck waiting for the sleep to finish, even though they have nothing to do with it. asyncio.sleep() is a coroutine that yields control back to the loop instead, letting other work proceed. This detector only checks that the same file defines an async def and uses await somewhere else, not that this exact time.sleep() call executes inside a coroutine.

How to fix it

If this call runs inside a coroutine (a function defined with async def, or reachable from one), replace it with await asyncio.sleep(seconds). If it genuinely runs on a separate thread (for example inside code executed via loop.run_in_executor or a background worker thread), time.sleep() there is fine and can be left as-is.

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Code Quality & Syntax checks