Exemplo n.º 1
0
        public void RunDictionaryPersonConstant()
        {
            GenerateDictionaty generate = CreatePersonDictionary;

            CheckTimeGenerateDictionary(100, generate, new ImplementationConstGetHashCode());
            CheckTimeGenerateDictionary(10000, generate, new ImplementationConstGetHashCode());
            CheckTimeGenerateDictionary(20000, generate, new ImplementationConstGetHashCode());
        }
Exemplo n.º 2
0
        private static void CheckTimeGenerateDictionary(int count, GenerateDictionaty func, IGetHashCode getHashCode)
        {
            Stopwatch stopwatch = new();

            stopwatch.Start();
            func(getHashCode, count);
            stopwatch.Stop();
            Console.WriteLine($"Время генерации для {count} объектов: {stopwatch.ElapsedMilliseconds}");
        }