Skip to content

Instantly share code, notes, and snippets.

@Jintian
Created January 10, 2013 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jintian/4501452 to your computer and use it in GitHub Desktop.
Save Jintian/4501452 to your computer and use it in GitHub Desktop.
command line percentage in java
public class Main {
public static void main(String[] argv) throws Exception{
String anim= "|/-\\";
for (int x =0 ; x < 100 ; x++){
String data = "\r" + anim.charAt(x % anim.length()) + " " + x ;
System.out.write(data.getBytes());
Thread.sleep(100);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment