示例#1
0
文件: Program.cs 项目: gzhangx/ccauto
        static void Main(string[] args)
        {
            ILog Logger     = LogManager.GetLogger("main");
            var  controller = new SimpleController();

            while (true)
            {
                DateTime startTime = DateTime.UtcNow;
                Logger.Info("Starting");
                try
                {
                    ccVcontrol.Program.Start(controller);
                    Logger.Info($"Sleeping, run time = {DateTime.UtcNow.Subtract(startTime).TotalSeconds.ToString("0.00")}s");
                    controller.Sleep(1000 * 60 * 60, true);
                    Logger.Info("Done Sleeping");
                } catch (SwitchProcessingActionException exc)
                {
                    controller.Log("info", "switching action " + exc.Message);
                }
            }
        }