Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Text;
- using Wintellect.PowerCollections;
- namespace ConsoleApp12
- {
- class Program
- {
- static void Main()
- {
- const int operations = 200_000;
- Stopwatch watch = new Stopwatch();
- Random random = new Random();
- //List
- watch.Start();
- List<char> justNormalList = new List<char>();
- for (int i = 0; i < operations; i++)
- {
- justNormalList.Insert(random.Next(0, i), 'a');
- }
- watch.Stop();
- Console.WriteLine(watch.Elapsed);
- //BigList
- watch = new Stopwatch();
- watch.Start();
- BigList<char> bigList = new BigList<char>();
- for (int i = 0; i < operations; i++)
- {
- bigList.Insert(random.Next(0, i), 'a');
- }
- watch.Stop();
- Console.WriteLine(watch.Elapsed);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement