728x90
JAVA] 시간 지연하는 방법
시간 (초) 지연(Delay)하는 방법
Thread.sleep();
Thread.sleep(1000); -> 1000은 1초
try {
Thread.sleep(300); // 0.3초 딜레이
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
728x90
'IT > Java' 카테고리의 다른 글
총알 피하기 게임 (3) | 2024.06.02 |
---|---|
[JAVA] session 세션 유효시간 설정 (0) | 2024.05.22 |
[JAVA] 현재 시간 구하는 방법 (0) | 2024.05.03 |
build.gradle httpclient 의존성 주입 에러 해결방법 (0) | 2024.05.02 |
Thymeleaf TemplateInputException 에러 해결방법 (0) | 2024.05.01 |