1 Star 0 Fork 0

ThisYoung/OnJava8-Examples

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
Nap.java 516 Bytes
Copy Edit Raw Blame History
Bruce Eckel authored 2017-01-24 00:19 +08:00 . Change delay time to double
// onjava/Nap.java
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
package onjava;
import java.util.concurrent.*;
public class Nap {
public Nap(double t) { // Seconds
try {
TimeUnit.MILLISECONDS.sleep((int)(1000 * t));
} catch(InterruptedException e) {
throw new RuntimeException(e);
}
}
public Nap(double t, String msg) {
this(t);
System.out.println(msg);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/thisyoung/OnJava8-Examples.git
git@gitee.com:thisyoung/OnJava8-Examples.git
thisyoung
OnJava8-Examples
OnJava8-Examples
master

Search