java sleep in code
import java.util.concurrent.TimeUnit
TimeUnit.SECONDS.sleep(1);
or
TimeUnit.MINUTES.sleep(1);Thread.sleep(2000);package com.journaldev.threads;
public class ThreadSleep {
public static void main(String[] args) throws InterruptedException {
long start = System.currentTimeMillis();
Thread.sleep(2000);
System.out.println("Sleep time in ms = "+(System.currentTimeMillis()-start));
}
}
Also in Java:
- mutable string in java
- how to print to the console in java
- java projects
- convert date to calendar java
- Enums injava
- java file class
- how to copy all files and subdirectories in directory in java
- java iterate over list
- system.out.println shortcut
- hide elements android
- splitting using regex java
- java copy array
- java square a number
- multiplication program java
- java test if a string is a int
- thread sleep java
- setbackground java
- java \t
- funzione random in java
- get drawable with string android java
- init cap java
- how to iterate hashmap java
- java for loop add multiple declarations
- java get input