示例#1
0
        public static void Main(string[] args)
        {
            IMPORTANCELEVEL x = IMPORTANCELEVEL.Error;

            for (int i = 0; i < args.Length; i++)
            {
                if (hlpF.check(ref i, args))
                {
                    usage();
                }
                else if (dbgF.check(ref i, args))
                {
                    ;
                }
                else if (vF.check(ref i, args))
                {
                    ;
                }
                else if (logLvl.check(ref i, args))
                {
                    ;
                }
                else if (logNm.check(ref i, args))
                {
                    x = Loger.strtoLvl(logNm);
                }
                else if (sleep.check(ref i, args))
                {
                    ;
                }
                else if (max.check(ref i, args))
                {
                    ;
                }
            }
            DateTime st = DateTime.Now;

            using (Loger l = new Loger(logNm, dbgF)){
                if (vF)
                {
                    l.cnslLvl = IMPORTANCELEVEL.Stats;
                }
                primer a = new primer("first", l, ThreadPriority.Normal);
                primer b = new primer("second", l);
                //       a.t.Priority = ThreadPriority.Lowest;
                a.t.Join();
                l.WriteLine(IMPORTANCELEVEL.Stats, "thread '{0}' finished with {1}/{2} numbers/primers"
                            , "first", a.numbers, a.primers);
                b.t.Join();
                l.WriteLine(IMPORTANCELEVEL.Stats, "thread '{0}' finished with {1}/{2} numbers/primers"
                            , "second", b.numbers, b.primers);
                DateTime fn = DateTime.Now;
                l.WriteLine(IMPORTANCELEVEL.Stats, "time of work is {0} secs"
                            , (fn - st).TotalSeconds);
            }
        }
示例#2
0
        static public void Main(string[] args)
        {
            for (int i = 0; i < args.Length; i++)
            {
                if (hlpF.check(ref i, args))
                {
                    usage();
                }
                else if (dbgF.check(ref i, args))
                {
                    ;
                }
                else if (vF.check(ref i, args))
                {
                    ;
                }
                else if (logLvl.check(ref i, args))
                {
                    ;
                }
                else if (perCent.check(ref i, args))
                {
                    ;
                }
                else if (flNm.check(ref i, args))
                {
                    ;
                }
                else if (tsk1.check(ref i, args))
                {
                    ;
                }
                else if (tsk2.check(ref i, args))
                {
                    ;
                }
            }
            if (!tsk1 && !tsk2)
            {
                usage();
            }

            DateTime st = DateTime.Now;

            using (LOGGER Logger = new LOGGER(LOGGER.uitoLvl(logLvl))){
                if (vF)
                {
                    Logger.cnslLvl = IMPORTANCELEVEL.Stats;
                }

                for (uint i = 0; i < 9; i++)
                {
                    Logger.WriteLine(LOGGER.uitoLvl(i)
                                     , "this is {0} iteration {1}  "
                                     , i, LOGGER.uitoLvl(i)
                                     );
                    Thread.Sleep(500);
                }

                if (perCent == 0.5)
                {
                    perCent.set(0.1);
                    Logger.WriteLine(IMPORTANCELEVEL.Info
                                     , "...0.5 has been changed to 0.1..."
                                     , (double)perCent
                                     );
                }

                DateTime fn = DateTime.Now;
                Logger.WriteLine(IMPORTANCELEVEL.Stats, "time of work with file '{1}' is {0} secs"
                                 , (fn - st).TotalSeconds, (string)flNm);
            }
        }
示例#3
0
        static void Main(string[] args)
        {
            for (int i = 0; i < args.Length; i++)
            {
                if (hlpF.check(ref i, args))
                {
                    usage();
                }
                else if (dbgF.check(ref i, args))
                {
                    ;
                }
                else if (vF.check(ref i, args))
                {
                    ;
                }
                else if (logLvl.check(ref i, args))
                {
                    ;
                }
                else if (nm.check(ref i, args))
                {
                    ;
                }
                else if (num.check(ref i, args))
                {
                    ;
                }
            }
            string field    = "input data";
            string variable = "first field1 ";



            //Param
            DateTime st    = DateTime.Now;
            int      ii    = 1;
            string   title = "";

            using (LOGGER l = new LOGGER(LOGGER.uitoLvl(logLvl))){
                l.cnslLvl = IMPORTANCELEVEL.Debug;
                l.WriteLine(IMPORTANCELEVEL.Spam, "cycle was started");

                {
                    if (vF)
                    {
                        l.cnslLvl = IMPORTANCELEVEL.Stats;
                    }

                    OkCancel f = new OkCancel("exit the application?");
dd:

                    DialogResult rc = f.ShowDialog();
                    if (rc == DialogResult.OK)
                    {
                        l.WriteLine(IMPORTANCELEVEL.Info, "You've pressed OK");
                    }
                    else
                    {
                        l.WriteLine(IMPORTANCELEVEL.Info, "You've pressed Cancel. Press yet more");
                        goto dd;
                    }
                }
                DateTime fn      = DateTime.Now;
                Process  curProc = Process.GetCurrentProcess();
                l.WriteLine(IMPORTANCELEVEL.Stats, "time of work/memory are {0} secs/{1} kBytes"
                            , (fn - st).TotalSeconds, curProc.PeakVirtualMemorySize64 / 1024);
            }
        }