三个For优化方案 JavaJ#
程序员文章站
2024-02-04 12:27:40
...
http://www.iteye.com/topic/762637
http://www.iteye.com/topic/762312
http://www.iteye.com/topic/632481
这三个贴子说的同一件事.....
java -server TestFFF
用时16
java TestFFF
用时1537
效率100比1吧
http://www.iteye.com/topic/762312
http://www.iteye.com/topic/632481
这三个贴子说的同一件事.....
package com.maodaju.tools.effection; public class TestFFF { public static void main(String[] args) { long start = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { for (int j = 0; j < 1000; j++) { for (int k = 0; k < 100; k++) { int t = i*j*k; } } } long end = System.currentTimeMillis(); System.out.println(end-start); } }
java -server TestFFF
用时16
java TestFFF
用时1537
效率100比1吧