问题描述
if(outputStream!= null){
outputStream.close();
}
}
}
else {
扫描仪linReader =新扫描仪(输入文件);
long start_time =系统。 currentTimeMillis();
while(linReader.hasNext())
{
String line = linReader.nextLine();
System.out.println(line);
}
linReader.close( );
long estimatedTime = System.currentTimeMillis() - start_time;
System.out.println(估计时间);
}
}
}
>
我尝试过:
如何将时间打印出来
if(outputStream != null){
outputStream.close();
}
}
}
else{
Scanner linReader = new Scanner(inputfile);
long start_time = System.currentTimeMillis();
while (linReader.hasNext())
{
String line = linReader.nextLine();
System.out.println(line);
}
linReader.close();
long estimatedTime = System.currentTimeMillis() - start_time;
System.out.println(estimatedTime);
}
}
}
>
What I have tried:
how do I will print it out the time
这篇关于如何读取文件并按输出打印输出时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!