【Java开源代码栏目提醒】:网学会员--在 Java开源代码编辑为广大网友搜集整理了:Timer0.java绩等信息,祝愿广大网友取得需要的信息,参考学习。
package chapter7;
import java.io.*;
import java.text.*;
public class Timer0 {
public static void main(String[] argv) throws IOException {
long t0, t1;
System.out.println("Press return when ready");
t0 = System.currentTimeMillis();
int b;
do {
b = System.in.read();
} while (b != '\r' && b != '\n');
t1 = System.currentTimeMillis();
double deltaT = t1 - t0;
System.out.println("You took "
+ DecimalFormat.getInstance().format(deltaT / 1000.)
+ " seconds.");
}
}