I am practically checking how much time taking by collection(s) insertion with 'N' elements,
Now I am stuck in checking total time taken by ArrayList in Insertion process.
Timestamp startTimeStamp = new Timestamp(System.currentTimeMillis());
System.out.println("Start Insertion :: "+startTimeStamp);
List<Integer> intList = new ArrayList<>();
for (int i = 0; i <= 100000000; i++) {
intList.add(i);
}
Timestamp endTimeStamp = new Timestamp(System.currentTimeMillis());
System.out.println("End insertion :: "+endTimeStamp);
// Total time taken
// TODO
Output : Start Insertion :: 2020-03-19 16:47:27.395 End insertion :: 2020-03-19 16:48:11.963