I code a little java programm. Every second I print a value in the console
System.out.println("Test");
I write a command in the moment, if the System.out. loop starts, my command just disappear and goes up with the System.out.println("").
This is my Code:
public class Main{
public static String s;
public static void main(String[] args) {
printLogo();
Timer timer = new Timer();
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
Data.cpuUsage = ((OperatingSystemMXBean) ManagementFactory
.getOperatingSystemMXBean())
.getSystemCpuLoad() * 100;
Data.totalMem = ((OperatingSystemMXBean) ManagementFactory
.getOperatingSystemMXBean())
.getFreePhysicalMemorySize() / 1000000;
System.out.println(Data.totalMemory);
}
}, 1000, 1000);
System.out.println("Please type a command:");
Maybe someone can help me? Sorry for my bad English.