Exemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var array    = typeof(Code.TestAll).GetMethods(BindingFlags.Static | BindingFlags.Public);
            var instance = new Code.TestAll();

            foreach (var item in array)
            {
                if (item.Name == "TestUpdate")
                {
                    continue;
                }
                item.Invoke(instance, null);
            }
            Response.Write("OK");
        }
Exemplo n.º 2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var    array    = typeof(ChloePerformanceTest.MappingSpeedTest).GetMethods(BindingFlags.Static | BindingFlags.Public);
            var    instance = new Code.TestAll();
            var    n        = Convert.ToInt32(TextBox1.Text);
            long   useTime;
            string txt = "查询 top " + n + "行数据\r\n";

            foreach (var item in array)
            {
                item.Invoke(null, new object[] { 1 });
                useTime = ChloePerformanceTest.SW.Do(() =>
                {
                    item.Invoke(null, new object[] { n });
                });
                GC.Collect();
                txt += string.Format("{0}用时:{1}ms\r\n", item.Name, useTime);
            }
            TextBox2.Text = txt;
        }