java进阶 -System类 -currentTimeMillis返回时间毫秒值 -arraycopy数组拷贝40
currentTimeMillis:
package com.cyjt97.SY; public class ay { public static void main(String[] args) { long start = System.currentTimeMillis(); String s = ""; for (int i = 0; i <100000 ; i++) { s +=i; } long end = System.currentTimeMillis(); System.out.println(end-start); } }
package com.cyjt97.SY; public class ay { public static void main(String[] args) { // long start = System.currentTimeMillis(); // String s = ""; // for (int i = 0; i <100000 ; i++) { // s +=i; // } // long end = System.currentTimeMillis(); // System.out.println(end-start); int arr[] = {11,22,33,44,55,66}; int dayArr[] = new int[3]; System.arraycopy(arr,1 ,dayArr,0,3); for (int i = 0; i < dayArr.length; i++) { System.out.println(dayArr[i]); } } }
代码改变了我们,也改变了世界