Time Complexity Calculator
Time Complexity Calculator is a VS Code extension that estimates the worst-case Big O time complexity of selected code using the Gemini API.
Features
- Analyze highlighted code from the active editor.
- Fall back to analyzing the full file when no text is selected.
- Show the estimated time complexity in a VS Code notification.
- Configure the Gemini API key and model from VS Code settings.
Requirements
You need a Gemini API key from Google AI Studio.
After installing or launching the extension, add your key in VS Code settings:
timeComplexity.apiKey
Usage
- Open a source code file.
- Select the code you want to analyze, or leave nothing selected to analyze the full file.
- Open the Command Palette.
- Run
Analyze Time Complexity.
The extension returns a concise Big O estimate such as O(n), O(n log n), or O(n^2).
Extension Settings
This extension contributes the following settings:
timeComplexity.apiKey: Gemini API key used for analysis.
timeComplexity.model: Gemini model used for analysis. Defaults to gemini-3.5-flash.
Known Issues
- Results are generated by an AI model and should be treated as estimates.
- Very large files may take longer to analyze or exceed API limits.
- The extension requires network access to the Gemini API.
Release Notes
0.0.1
Initial release with command-based time complexity analysis.
| |