コード例 #1
0
        static void Main(string[] args)
        {
            if (args.Count() < 1)
            {
                PrintUsage();
                return;
            }
            var stopwatch = Stopwatch.StartNew();

            try
            {
                Task.Factory.StartNew(() => ConsoleSpinner.RunAnimation());


                ProcessingOptions options = new ProcessingOptions();
                for (int i = 1; i < args.Count(); i++)
                {
                    ParseArgs(args, i, ref options);
                }

                var processor = new DataProcessor(new Logger());
                processor.Process(args[0], options);

                stopwatch.Stop();
                Console.WriteLine($"Operation completed in {stopwatch.Elapsed}");
            }
            catch (Exception e)
            {
                Console.WriteLine($"Error occurred: {e.Message}");
                Console.WriteLine($"{stopwatch.Elapsed}");
            }
        }
コード例 #2
0
        public static void RunAnimation()
        {
            ConsoleSpinner spin = new ConsoleSpinner();

            while (true)
            {
                spin.Turn();
                Thread.Sleep(100);
            }
        }