A CLI tool that scans your source code project for calls to sleep(...), aimed to find hidden bottlenecks.
pip install sleep-detectorsleep-detector /path/to/your/codebase --config sleep_detector.tomlYou must supply a configuration file to specify:
- Which directories to exclude
- Which file extensions to scan
- What regex pattern to match
excluded_dirs = ["venv", ".git", "build", "__pycache__"]
file_extensions = [".py"]
sleep_pattern = "\\b(?:time\\.)?sleep\\s*\\(\\s*(\\d+(?:\\.\\d+)?)\\s*\\)"Run the tool:
sleep-detector . --config sleep_detector.toml