This repository contains a simple C program that displays a progress bar in the console for a duration of 10 seconds. The progress bar updates every half second, providing a visually appealing way to represent the loading status of an operation.
- Customizable total duration and steps for the progress bar
- Compatible with Windows systems
- Easy to integrate into other projects
To use this program, follow these steps:
- Clone the repository to your local machine:
git clone https://github.com/RealWorga/c_loading_bar.git
- Navigate to the project directory:
cd c_loading_bar
- Compile the C program using a C compiler such as GCC:
gcc -o progress-bar-loader cool_loading_bar.c
To run the progress bar loader, simply execute the compiled binary:
./progress-bar-loader.exe
You should see the progress bar updating in the console for 10 seconds, like this:
Loading... [##..................] 10%
Once the progress bar reaches 100%, the program will display "Loading complete!" and exit.
You can easily customize the duration and steps of the progress bar by modifying the total_duration
and steps
variables in the main.c
file.
For example, if you want the progress bar to last for 5 seconds and update every 0.25 seconds, you would update the variables like this:
int total_duration = 5000; // 5 seconds in milliseconds int steps = 20;
After modifying the variables, recompile and run the program to see the changes take effect.