- /**
- *
- */
- package refection;
- /**
- * @author MID
- *
- */
- public class Test {
- /**
- * @param args
- */
- public static void main(String[] args) {
- // Long sun = 0L;
- long sum = 0L;
- long begin = System.currentTimeMillis();
- for(int i = 0;i < Integer.MAX_VALUE;i++) {
- sum += i;
- }
- long end = System.currentTimeMillis();
- System.out.println(sum);
- System.out.println(end - begin);
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/061120136911.html
来源: http://www.codesnippet.cn/detail/061120136911.html