0
Running Clock?
I'd like to make a running clock that changes in realtime in the output. I would imagine the program would have to rerun itself constantly?? Is that possible?
2 Answers
+ 1
The program doesn't need to rerun itself. You would just need to use a loop that checks the time and updates the clock until the program is exited etc. There are many ways that you could do this.
boolean exit = false;
while(!exit) {
// code here
}
0
Okay so that is working but because I'm using System.currentTimeMillis() to get the time it prints the time (hour,minute,second) 1000 times! Is there a different method to use to get the time or is there a better way to fix it?