public static Thread createProgressThread ( final long intervalMs , final PrintStream stream ) { Thread thread = new Thread ( new Runnable ( ) { @ Override public void run ( ) { while ( true ) { CommonUtils . sleepMs ( intervalMs ) ; if ( Thread . interrupted ( ) ) { return ; } stream . print ( "." ) ; } } } ) ; thread . setDaemon ( true ) ; return thread ; }
Creates a thread which will write . to the given print stream at the given interval . The created thread is not started by this method . The created thread will be daemonic and will halt when interrupted .