I have this timer function written in java.
import java.util.Timer; //Libraries used
import java.util.TimerTask;
public static void main(String[] args) {
Timer clock = new Timer();
clock.schedule(new TimerTask() {
@Override
public void run() {
System.out.println(Runtime.getRuntime().freeMemory());
}
}, 1*1*1000, 1*1*1000);// One second intervals
}
I get this as a result(in bits):
115224312
113179200
113179200
...Same number(113179200)...forever
I want this function to auto refresh and change the number, but it does not do that. And I am unsure why. I have tried other methods(loops, other timers, etc.), but those do not work either.