1、百 级别的数据(100)
2、千 级别的数据(1000)
3、万 级别的数据(10000)
4、十万 级别的数据(100000)
5、百万 级别的数据(1000000)
6、千万 级别的数据(10000000)
附上代码:
public static void main(String[] args) { long l1 = System.currentTimeMillis(); ArrayList arrayList = new ArrayList(); for (int i = 1; i < 100; i++) { arrayList.add(i); } long l2 = System.currentTimeMillis(); System.out.println(l2 - l1); LinkedList linkedList = new LinkedList(); for (int i = 1; i < 100; i++) { linkedList.add(i); } long l3 = System.currentTimeMillis(); System.out.println(l3 - l2); Map map = new HashMap(); for (int i = 1; i < 100; i++) { map.put(i,i); } long l4 = System.currentTimeMillis(); System.out.println(l4 - l3); Map treeMap = new TreeMap<>(); for (int i = 1; i < 100; i++) { treeMap.put(i,i); } long l5 = System.currentTimeMillis(); System.out.println(l5 - l4); }