Skip to content

CLI tool to measure the empirical time efficiency of C programs by compiling and running them with a given input size.

License

Notifications You must be signed in to change notification settings

Pranavh-2004/TimeEffiCiency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TimeEffiCiency

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.

Features

  • 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.

Installation

Prerequisites

  • GCC (GNU Compiler Collection) for compiling C programs.
  • A UNIX-like environment (macOS, Linux, etc.).

Clone the Repository

git clone https://github.com/your-username/TimeEffiCiency.git
cd TimeEffiCiency

Build the Project

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.

Usage

Running the Tool

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.

Example Output

Processing input size: 100
Completed processing.
Execution Time for tests/test_program1.c with input size n = 100: 0.000123 seconds

Directory Structure

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

Contributing

Feel free to fork this repository and submit pull requests if you would like to contribute.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

CLI tool to measure the empirical time efficiency of C programs by compiling and running them with a given input size.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published