Benchmarks.Program.BenchAutoMapper C# (CSharp) Method

BenchAutoMapper() static private method

static private BenchAutoMapper ( int mappingsCount ) : long
mappingsCount int
return long
        static long BenchAutoMapper(int mappingsCount)
        {
            AutoMapper.Mapper.CreateMap<BenchSource.Int1, BenchDestination.Int1>();
            AutoMapper.Mapper.CreateMap<BenchSource.Int2, BenchDestination.Int2>();
            AutoMapper.Mapper.CreateMap<BenchSource, BenchDestination>();

            var s = new BenchSource();
            var d = new BenchDestination();

            var sw = new Stopwatch();
            sw.Start();
            for (int i = 0; i < mappingsCount; ++i)
            {
                AutoMapper.Mapper.Map(s, d);
            }
            sw.Stop();
            return sw.ElapsedMilliseconds;
        }