예제 #1
0
파일: Program.cs 프로젝트: iosmany/IoCImpl
        static void Main(string[] args)
        {
            Stopwatch sw = new Stopwatch();

            sw.Start();

            Contenedor.Register <IService, Service>();
            Contenedor.Register <IServiceWithCtorParams, ServiceWithCtorParams>();

            sw.Stop();

            int attempts = 1;

            while (attempts < 101)
            {
                DoWork();
                Console.WriteLine($"Waiting for!");
                System.Threading.Thread.Sleep(3000);
                Console.WriteLine($"Attempt {attempts} overcomed!");
                attempts++;
            }

            Console.WriteLine($"Tiempo : {sw.ElapsedMilliseconds} ms");
            Console.ReadLine();
        }