public void RunDictionaryPersonConstant() { GenerateDictionaty generate = CreatePersonDictionary; CheckTimeGenerateDictionary(100, generate, new ImplementationConstGetHashCode()); CheckTimeGenerateDictionary(10000, generate, new ImplementationConstGetHashCode()); CheckTimeGenerateDictionary(20000, generate, new ImplementationConstGetHashCode()); }
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}"); }