Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⏱️ Clock Generator (Date + Time)

Developer: Israel Wasserman LinkedIn

This project simulates a digital clock that continuously generates complete date and time sequences using Python generators. By leveraging generators, the system produces one value at a time in a memory-efficient way, without storing large lists in memory. This approach is ideal for handling long-running or infinite time streams, and demonstrates how clean, modular design combined with generator-based logic can lead to efficient and elegant code.

πŸ“‚ Project Structure

clock_project/
β”‚
β”œβ”€β”€ clock_generator/
β”‚   β”œβ”€β”€ time_gen.py
β”‚   β”œβ”€β”€ date_gen.py
β”‚   └── utils.py
β”‚
β”œβ”€β”€ main.py
└── README.md

πŸš€ How to Run

python main.py

The screen will update every 1,000,000 iterations (can be changed in the 'main.py' module) with the current generated timestamp starts at 2019 year my default, this parameter can be edited in the 'date_gen.py' module >>'gen_year()' generator function.

🧠 Highlights

  • Efficient use of Python generators
  • Clean modular structure
  • Leap year detection
  • Formatted output (e.g., 2024/02/29 13:45:07)
  • Console-clearing for a clean, real-time-like display

πŸ“œ License

MIT License β€” free to use, modify, and distribute.

About

Modular Python clock simulation using memory-efficient generators to produce endless date and time sequences with clean, structured design

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages