concurrencypuzzlers/src/chapter1/sleepers/Sleeper2.java
2019-09-20 15:36:54 +02:00

15 lines
317 B
Java

package chapter1.sleepers;
import java.util.concurrent.TimeUnit;
public class Sleeper2 {
/* now the unit is clear*/
public static void main(String[] args) throws InterruptedException {
System.out.println("sleep");
TimeUnit.SECONDS.sleep(1);
System.out.println("wake up");
}
}