请详细分析或者发个有详细分析的链接。
嫌我问题短。。。把代码也发一下吧。
double b = 0; String s = ""; long ii = System.currentTimeMillis(); for(int i = 0; i<20000;i++) { try { b = StrictMath.pow(b+i, 1.0/3); s = s + b+";"; }catch(Exception e){ e.printStackTrace(); }finally { } } //System.out.println("b = "+b + "\ns = "+ s); System.out.println(System.currentTimeMillis()-ii); double c = 0; String ss = ""; long iii = System.currentTimeMillis(); for(int i = 0; i<20000;i++) { c = StrictMath.pow(c+i, 1.0/3); ss = ss + c+";"; } //System.out.println("b = "+c + "\nss = "+ ss); System.out.println(System.currentTimeMillis()-iii);
这是我的测试代码,输出如下
17114
16397
湖上湖
HUX布斯
UYOU
繁花如伊
相关分类