Java 텍스트 스피너

개요[ | ]

Java 텍스트 스피너
public class App {
    public static void main(String[] args) throws InterruptedException {
        textSpinner(5000);
    }
    private static void textSpinner(int duration_milliseconds) throws InterruptedException {
        String a = "|/-\\";
        long start = System.currentTimeMillis();
        int i = 0;
        while (System.currentTimeMillis() - start < duration_milliseconds) {
            System.out.print("\033[1D"+a.charAt(i));
            i++;
            if( i > a.length()-1 ) i = 0;
            Thread.sleep(200);
        }
    }
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}