Exemplo n.º 1
0
        private void Timer_Tick(ThreadPoolTimer timer)
        {
            timer.Cancel();

            list.Clear();

            var sw = new Stopwatch();

            sw.Start();

            var mercury = new MercuryAccess();
            var success = mercury.CallMPS().Result;

            sw.Stop();

            elapsedTime = (double)sw.ElapsedMilliseconds / (double)1000.0;

            list.Add(string.Format("{0}    ElapsedTime: {1}", DateTime.Now, elapsedTime));

            totalTime += elapsedTime;

            list.Add(string.Format("{0}    TotalTime: {1}", DateTime.Now, totalTime));

            totalTransactions++;

            list.Add(string.Format("{0}    Total Transactions: {1}", DateTime.Now, totalTransactions));

            averageTimePerTransaction = (double)totalTime / (double)totalTransactions;

            list.Add(string.Format("{0}    Average Transaction Time: {1}", DateTime.Now, averageTimePerTransaction));

            totalToBlinkGreen = 10;
            totalToBlinkRed   = 10;
            NextActionIsShowTransactionTiming = true;

            ShowTransactionSuccess(success);
        }
        private void Timer_Tick(ThreadPoolTimer timer)
        {
            timer.Cancel();

            list.Clear();

            var sw = new Stopwatch();
            sw.Start();

            var mercury = new MercuryAccess();
            var success = mercury.CallMPS().Result;
            sw.Stop();

            elapsedTime = (double)sw.ElapsedMilliseconds/(double)1000.0;            

            list.Add(string.Format("{0}    ElapsedTime: {1}", DateTime.Now, elapsedTime));

            totalTime += elapsedTime;

            list.Add(string.Format("{0}    TotalTime: {1}", DateTime.Now, totalTime));

            totalTransactions++;

            list.Add(string.Format("{0}    Total Transactions: {1}", DateTime.Now, totalTransactions));

            averageTimePerTransaction = (double)totalTime / (double)totalTransactions;

            list.Add(string.Format("{0}    Average Transaction Time: {1}", DateTime.Now, averageTimePerTransaction));

            totalToBlinkGreen = 10;
            totalToBlinkRed = 10;
            NextActionIsShowTransactionTiming = true;

            ShowTransactionSuccess(success);            
        }