I have to write a program that mimics a digital clock w/ seconds, minutes, and hours. I'm sure I can get the displays working on my own and everything. My concern: what is the most efficient way to check the time? Should I just do Thread.sleep for 1 second then update things accordingly? Or should I use Java's date and time classes to do this? If I use the date & time in, say, a while loop, it would be inefficient since I really only need to check to see if something is a new time every second.
BestJewSinceJC 700 Posting Maven
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
BestJewSinceJC 700 Posting Maven
BestJewSinceJC 700 Posting Maven
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.