Example #1
0
        private void MulitPlusCounter(object para)
        {
            List <object> paras  = para as List <object>;
            int           index  = Convert.ToInt32(paras[0]);
            long          target = Convert.ToInt64(paras[1]);
            AM            am     = null;

            if (paras.Count > 2)
            {
                am = paras[2] as AM;
            }
            Stopwatch sw  = new Stopwatch();
            string    msg = string.Format("[{0}] Thread<{1}> started.\n",
                                          DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), index);

            LogMsgs.Add(msg);
            sw.Start();
            for (long i = 0; i < target; i++)
            {
                ;
            }
            sw.Stop();
            Result[index]      = sw.ElapsedMilliseconds;
            resultState[index] = true;

            am?.Invoke();

            msg = string.Format("[{0}] Thread<{1}> stopped.\n",
                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), index);
            LogMsgs.Add(msg);
        }