命令行打印进度

 

public class TTest extends TimerTask

{

int i = 0;

public static void main(String[] args) throws IOException

{

Timer timer = new Timer();

timer.schedule(new TTest(), 1, 300);

}

public void run()

{

if(i < 100)

{

System.out.print("进度:"+(++i) + "%\r");

}

else

{

System.out.println("OK!");

System.exit(0);

}

}

}

你可能感兴趣的:(命令行)