TimeEffiCiency
is a command-line tool designed to measure the empirical time efficiency of C programs. The tool compiles and runs C files, measuring their execution time for a given input size n
.
- Empirical Time Measurement: Measures the actual execution time of a C program by compiling and running it with a given input size.
- CLI Tool: Simple command-line interface for easy integration into your workflow.
- Works with Any C File: Supports any C program that accepts input size
n
as a command-line argument.
- GCC (GNU Compiler Collection) for compiling C programs.
- A UNIX-like environment (macOS, Linux, etc.).
git clone https://github.com/your-username/TimeEffiCiency.git
cd TimeEffiCiency
Run the following command to build the project:
make
This will compile the source code and create an executable called TimeEffiCiency in the build/ directory.
To measure the time efficiency of a C program, run:
./build/TimeEffiCiency <C file> <input size n>
Where:
- is the path to the C program you want to analyze.
- is the input size that the program will process.
For example:
./build/TimeEffiCiency tests/test_program1.c 100
This will compile and run the test_program1.c file with an input size of 100, and output the execution time.
Processing input size: 100
Completed processing.
Execution Time for tests/test_program1.c with input size n = 100: 0.000123 seconds
TimeEffiCiency/
├── LICENSE
├── Makefile
├── README.md
├── build/ # Compiled executables and temporary files
├── src/ # Source files
│ ├── compile_and_run.c # Compilation and execution logic
│ ├── compile_and_run.h # Header for the compile_and_run.c
│ └── main.c # Main program logic
└── tests/ # Test C programs
└── test_program1.c # Sample test program
Feel free to fork this repository and submit pull requests if you would like to contribute.
This project is licensed under the MIT License - see the LICENSE file for details.