A simple Rust program that waits for a specified amount of time and then plays an alarm sound. This can be used as a reminder or notification tool.
- Waits for a specified duration (in seconds, minutes, or hours).
- Repeats the alarm sound a specified number of times.
- Plays an MP3 file as the alarm sound.
- Rust (Install from rust-lang.org)
- MP3 file named
alarm_sound.mp3in the root directory libasound2-devinstalled on Linux devices
- Clone the repository:
git clone https://github.com/KPCOFGS/Timer_in_Rust.git
cd Timer_in_Rust/Timer- Build the project:
cargo build --releaseThe program accepts the following command-line arguments:
--seconds (default: 0): Number of seconds to wait.
--minutes (default: 0): Number of minutes to wait.
--hours (default: 0): Number of hours to wait.
--repeat_times (default: 1): Number of times to repeat the alarm sound.
To wait for 1 minute and 30 seconds and repeat the alarm sound 3 times, use:
./target/release/new_project --seconds 30 --minutes 1 --repeat_times 3- The program parses the command-line arguments to determine the total sleep time.
- It waits for the specified amount of time.
- After the wait, it plays the
alarm_sound.mp3file the specified number of times.
This project is licensed under the Unlicense - see the LICENSE file for details.