예제 #1
0
        private void btnSQL_Click(object sender, EventArgs e)
        {
            DataTable dt;
            CPerf     perf = m_SocketPool.Seek();

            m_watch.Reset();
            m_watch.Start();
            if (chkAsync.Checked)
            {
                for (int n = 0; n < 100; n++)
                {
                    perf.SendRequest(perfConst.idOpenRecordsCPerf, txtSQL.Text, (ar) =>
                    {
                        dt = perf.CurrentDataTable;
                    });
                }
                perf.WaitAll();
            }
            else
            {
                for (int n = 0; n < 100; n++)
                {
                    dt = perf.OpenRecords(txtSQL.Text);
                }
            }
            m_watch.Stop();
            txtTime.Text = m_watch.ElapsedMilliseconds.ToString();
        }
예제 #2
0
        private void btnEcho_Click(object sender, EventArgs e)
        {
            string str;
            CPerf  perf = m_SocketPool.Seek();

            m_watch.Reset();
            m_watch.Start();
            if (chkAsync.Checked)
            {
                for (int n = 0; n < 10000; n++)
                {
                    perf.SendRequest(perfConst.idMyEchoCPerf, "TestEcho", (ar) =>
                    {
                        ar.Load(out str);
                    });
                }
                perf.WaitAll();
            }
            else
            {
                for (int n = 0; n < 10000; ++n)
                {
                    str = perf.MyEcho("TestEcho");
                }
            }
            m_watch.Stop();
            txtTime.Text = m_watch.ElapsedMilliseconds.ToString();
        }