Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Java Multithreaded Clock

A simple, command-line digital clock application written in Java. This project demonstrates the fundamentals of multithreading by using separate threads for updating and displaying the current time concurrently.

Features

  • Displays the current time and date, updated every second.
  • Utilizes a separate thread for background time updates and another for console display.
  • Implements thread priorities to ensure the display thread is responsive.
  • Uses the volatile keyword for thread-safe communication between threads.
  • Provides a clean, single-line output that overwrites itself, creating a dynamic display.

Technologies Used

  • Java
  • Java Time API (java.time)

How to Run

  1. Clone the repository:

    git clone https://github.com/Toothless5143/java-multithreaded-clock/
    cd java-multithreaded-clock
  2. Navigate to the source directory:

    cd src
  3. Compile the Java files:

    javac SimpleClockApplication.java Clock.java
  4. Run the application:

    java SimpleClockApplication

The current time will be displayed in your console, updating every second. Press Ctrl + C to stop the application.

About

A simple, lightweight console application written in Java that displays the current time and date. This project serves as a practical demonstration of Java's multithreading capabilities, including the use of separate threads for background tasks and UI updates, and the implementation of thread priorities for performance management.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages