Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 1.04 KB

File metadata and controls

54 lines (36 loc) · 1.04 KB

Rust Countdown Timer

A simple, functional countdown timer for the terminal written in Rust.

Description

This is a lightweight countdown timer that runs in your terminal. It displays the remaining time with color formatting and can parse various time formats including hours, minutes, and seconds.

Features

  • Parse time in formats: 30s, 5m, 2h, 1h30m, 1h30m45s
  • Color-coded output (green for running, yellow for final 10 seconds, red when done)
  • Clear terminal display
  • System beep when timer completes

Usage

Run the timer

cargo run -- 5m

Examples

# 30 seconds
cargo run -- 30s

# 5 minutes
cargo run -- 5m

# 2 hours
cargo run -- 2h

# Combined format
cargo run -- 1h30m45s
cargo run -- 2m30s

Installation

  1. Make sure you have Rust installed: https://rustup.rs/
  2. Clone this repository
  3. Run cargo build --release
  4. The binary will be in target/release/countdown-timer

How to Run

cargo run -- <time>

Where <time> is a duration string like 5m, 30s, 1h30m, etc.