Skip to content

Instantly share code, notes, and snippets.

@alan-mushi
alan-mushi / progressbar.java
Created October 28, 2012 17:11
Barre de progression pour la console en java
public class progressbar {
public static void main( String[] args ) {
System.out.println( "[*] Running ..." ) ;
for ( int i = 1 ; i < 101 ; i++ ) {
System.out.flush() ;
System.out.print( "\r " + ( i == 100 ? "100" : " " + ( i < 10 ? " " + i : i) ) + " % " ) ;
System.out.print( "[" ) ;
for ( int j = 0 ; j < i-1 ; j++ ) { System.out.print( "=" ) ; }