Time is our most valuable resource. But we don't have any power over time anywhere, except on the planet of Tralfamadore. That's why there are no programmers on Tralfamadore, while Terra is full of them—because they help other people save time. Let's celebrate automation by measuring how long it takes to perform 10,000 insertions on a LinkedList and an ArrayList.
Time for 10,000 insertions
You must be signed in to leave a comment
Marek Pasierbek Working at Nexus Polska
14 July 2020, 07:09
Try do ii with 100000 items..... 694 vs 4 miliseconds.
9 April 2020, 15:09
Wow that's uhh, fast. I was expecting the numbers returned to be much higher.
25 November 2019, 18:49
For anyone wondering, the Date class is deprecated.Use that instead.
13 November 2021, 03:03
7 August 2019, 11:22
If you run it more than once you will get different outputs. Like 14 and 2 , 15 and 2 , 16 and 4, etc. Can anyone explain why?
19 March 2019, 14:13
LinkedList is a lot faster ;)
22 December 2020, 22:23
:D You destroy the hole purpose of the task :D