CTimer is a simple terminal-based timer application written in C. It can either display the current time or count down from a specified number of seconds. The time is displayed in a stylized format using ASCII art.
To compile the project, you can use the provided Makefile
. Simply run:
make
This will produce an executable named ctimer
.
To display the current time:
./ctimer
To start a countdown timer from a specified number of seconds:
./ctimer <time>
For example, to start a countdown timer from 60 seconds:
./ctimer 60
<time>
: The number of seconds to count down from. If not provided, the current time will be displayed.
Display the current time:
./ctimer
Start a countdown timer from 30 seconds:
./ctimer 30
The appearance of the timer can be customized by modifying the symbols and colors used for the foreground and background. These can be set in the style.h
file.
#define RESET "\033[0m"
#define RED "\033[31m"
#define GREEN "\033[32m"
#define YELLOW "\033[33m"
#define BLUE "\033[34m"
#define MAGENTA "\033[35m"
#define CYAN "\033[36m"
#define WHITE "\033[37m"
#define BG_SYM " "
#define BG_COLOR WHITE
#define FG_SYM "█"
#define FG_COLOR WHITE
This project is licensed under the MIT License. See the LICENSE file for more details.