I am trying to run a line of code every second by using System.currentTimeMillis();.
The code:
while(true){ long var = System.currentTim
You should have to use java.util.Timer and java.util.TimerTask class.
java.util.TimerTask