public class test
{
public static void main(String[] args) throws Exception
{
File infile = new File(args[0]);
if(infile.exists())
{
FileReader fr = new FileReader(infile);
String str=" ";
try
{
BufferedReader br = new BufferedReader(fr);
while((str=br.readLine()) != null)
{
;
}
br.close();
}catch (FileNotFoundException e) {System.out.println("file not found");}
fr.close();
}
}
}
这个程序读一个50M的文件开机后第一次执行1.5秒,然后第二次1秒,希望开机首次执行就能达到1秒,有可能吗?
{
public static void main(String[] args) throws Exception
{
File infile = new File(args[0]);
if(infile.exists())
{
FileReader fr = new FileReader(infile);
String str=" ";
try
{
BufferedReader br = new BufferedReader(fr);
while((str=br.readLine()) != null)
{
;
}
br.close();
}catch (FileNotFoundException e) {System.out.println("file not found");}
fr.close();
}
}
}
这个程序读一个50M的文件开机后第一次执行1.5秒,然后第二次1秒,希望开机首次执行就能达到1秒,有可能吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货