package J20250723;

import java.util.ArrayList;
import java.util.LinkedList;

/**
 * @author WanJl
 * @version 1.0
 * @title Demo03_LinkedList
 * @description
 * @create 2025/7/23
 */
public class Demo03_LinkedList {
    public static void main(String[] args) {
        ArrayList<String> list=new ArrayList<>();
        //方法开始之前，先记个时间
        long start = System.currentTimeMillis();
        for (int i = 0; i < 2000000; i++) {
            list.add("hello "+i);
        }
        long end = System.currentTimeMillis();

        System.out.println("插入2000000条耗时："+(end-start));
        String s = list.get(999000);
        System.out.println(s);
        long end1 = System.currentTimeMillis();
        System.out.println("查询999000元素耗时："+(end1-end));


    }


}
