CP Runner is a lightning-fast, lightweight Visual Studio Code extension built specifically for competitive programmers. It lets you run and test C++, Java, and Python code instantly with built-in Time Limit Exceeded (TLE) protection, custom input handling, and cross-platform process memory tracking.
🚀 Features
Multi-Language Support: Seamlessly compiles and runs C++, Java, and Python code.
TLE Protection: Automatically kills runaway infinite loops and terminates processes exceeding your configured time limit, displaying any partial output generated up to that point.
Peak Memory & Time Metrics: Tracks precise execution time (in ms) and peak RAM usage (in MB) cross-platform.
Smart Heuristics: Automatically detects competitive programming folders and sets up workflows without interfering with large projects.
Interactive Webview UI: Clean side panel for input management, real-time output display, and error logging.
📋 Requirements
To run code successfully, ensure you have the appropriate runtimes installed and added to your system's PATH:
C++: GCC / G++ (g++)
Java: Java Development Kit (javac & java)
Python: Python 3 (python3 or python)
⌨️ Usage
Open any standalone .cpp, .java, or .py file.
Open the CP Runner panel or trigger the run command via your command palette / shortcut.
Provide any custom test case inputs and view your output along with execution metrics instantly!
⚙️ Extension Settings
This extension contributes the following settings:
cp-runner.timeout: Sets the time limit in milliseconds before triggering TLE (default: 3000ms).