📄 readunbufferedtest.java
字号:
/**
* @(#)ReadUnbufferedTest.java
*
*
* @author
* @version 1.00 2007/11/16
*/
import java.io.*;
public class ReadUnbufferedTest {
/**
* Creates a new instance of <code>ReadUnbufferedTest</code>.
*/
public ReadUnbufferedTest() {
}
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
double sum=0;
try {
long start=System.currentTimeMillis();
FileInputStream fs_in=new FileInputStream("4.txt");
DataInputStream in=new DataInputStream(fs_in);
for (int i=0; i<100000; i++)
{ double d=in.readDouble();
System.out.println(d);
sum+=d;
}
in.close();
long stop=System.currentTimeMillis();
System.out.println("Average:"+(sum/100000));
System.out.println("Time passed:"+(stop-start));
}
catch (IOException ioe) {
System.out.println(ioe);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -