Ejemplo n.º 1
0
        public static void Main()
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            NQueensSolver solver = new NQueensSolver(1000);

            solver.Solve();

            stopwatch.Stop();
            Console.WriteLine("Execution time: {0}", stopwatch.Elapsed);
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            // Input
            Console.WriteLine("Enter N:");
            int n = int.Parse(Console.ReadLine());

            // Start Timer
            var watch = System.Diagnostics.Stopwatch.StartNew();

            // N Queens Solver
            var solver = new NQueensSolver(n);

            solver.Solve();
            solver.PrintSolution();

            // Stop Timer
            watch.Stop();
            var elapsedMs = watch.ElapsedMilliseconds;

            // Print Time Result
            Console.WriteLine();
            Console.WriteLine($"--> Total time: {elapsedMs} ms.");
            Console.WriteLine();
        }