Bruce Eckel bc0026c3e1 Radically reorganized
Plus many new examples in "streams" chapter.
2015-11-11 20:20:04 -08:00

15 lines
268 B
Java

// onjava/Sleep.java
// Sleep for n seconds.
package onjava;
import java.util.concurrent.*;
public class Sleep {
public Sleep(int n) {
try {
TimeUnit.SECONDS.sleep(n);
} catch(InterruptedException e) {
throw new RuntimeException(e);
}
}
}