The Timer, the World Clock, and the Stopwatch are three unique features of this C program Chronograph, which includes a flexible time-related utility. Users can choose one of these features from the program's user-friendly interface and can interact with each part as follows:
- Timer Functionality: Users can set a countdown timer using this functionality. Users enter hours, minutes, and seconds, and the timer counts down in real-time, displaying the amount of time left in the format "HH:MM:SS." The timer is pauseable and reversible by users. The application announces "Time's up!!" when the counter reaches zero.
- World Clock Functionality: Users can view the current time and date in several time zones with this functionality. The code calculates and displays the corresponding local time and date when a time zone abbreviation (IST, EST, CST, MST, PST) is chosen.
- Stopwatch Functionality: Users can calculate elapsed time using the stopwatch. Hours, minutes, and seconds are shown on the display in the following format: "HH:MM:SS." The stopwatch can be reset, paused, and continued by users. Furthermore, they can record timestamps by pressing the Enter key and saving them for later use.
- Clone the Repository:
git clone https://github.com/karts13/Chronograph.git cd Chronograph
- Do the necessary customizations.
- Compile the Code:
gcc chrono.c -o chrono
- After successful compilation, an executable file named
chrono
will be generated. Run the compiled executable./chrono
- Upon running the program, a menu will be displayed with three options shown in Output 2.
- Enter the number corresponding to your desired functionality and press Enter.
- Follow the prompts for each selected functionality as described in the previous instructions:
- For the Timer, input the countdown duration and interact with the timer using 'p', 'r', and 's' keys.
- For the World Clock, input a time zone abbreviation and view the current time and date.
- For the Stopwatch, interact with the stopwatch using 'p', 'r', 's', and Enter key.
- To exit the program, you can press
Ctrl+C
in the terminal where the program is running.
This code can be easily customized to meet your specific needs. Here are some things you may want to modify:
- Time Units: Adjust the code to work with different time units (e.g., milliseconds, centiseconds) instead of seconds.
- Custom Time Zones: Add more time zones and corresponding offsets to the
worldClock
function.- Time Formatting: Modify the formatting of displayed time, such as showing fractions of seconds or using a 24-hour time format.
- Add Sounds: Integrate sound effects for specific events, such as when the timer reaches zero or when a timestamp is captured.
- Timestamp Limit: Change the maximum limit of timestamps stored in the Stopwatch to any desired value.
Text Editor
Chronograph Menu
Timer
World Clock
Stopwatch with Timestamps
If you find any issues or have suggestions for improvement, please open an issue or create a pull request.