I want to determine the time spent on deleting the elements of the collection, but for some reason, regardless of the number of elements, it gives 0 ms
static void Main(string[] args) { Stopwatch stopWatch = new Stopwatch(); Stopwatch sw = new Stopwatch(); ArrayList al = new ArrayList(); Console.Write("ΠΠ²Π΅Π΄ΠΈΡ ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ² ΠΊΠΎΠ»Π»Π΅ΠΊΡΠΈΠΈ: "); int collectionLength = Int32.Parse(Console.ReadLine()); stopWatch.Start(); for (int i = 0; i < collectionLength; i++) al.Add(CreateRandomString()); foreach (var s in al) Console.Write("{0}\t", s); stopWatch.Stop(); Console.WriteLine("ΠΡΠ΅ΠΌΡ Π·Π°ΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ ΠΊΠΎΠ»Π»Π΅ΠΊΡΠΈΠΈ: {0}",stopWatch.ElapsedMilliseconds + " ms"); Console.WriteLine("ΠΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ² Π² ΠΊΠΎΠ»Π»Π΅ΠΊΡΠΈΠΈ: {0}", collectionLength); sw.Start(); al.RemoveRange(0,collectionLength); sw.Stop(); Console.WriteLine(al.Count); Console.WriteLine("ΠΡΠ΅ΠΌΡ ΡΠ΄Π°Π»Π΅Π½ΠΈΡ: {0}", sw.ElapsedMilliseconds + " ms"); Console.ReadLine(); } static string CreateRandomString() { var sb = new StringBuilder(10); for (int i = 0; i < 10; i++) { var randomIndex = r.Next(chars.Length); sb.Append(chars[randomIndex]); } return sb.ToString();