using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using MrWu.Debug;

namespace GlobalSever.Form {
    /// <summary>
    /// 测试用
    /// </summary>
    public partial class TestTab : ServerTable {

        /// <summary>
        /// 测试..
        /// </summary>
        public override string tableText => "测试";

        /// <summary>
        /// 
        /// </summary>
        public TestTab(ServerProxy server) {
            this.server = server;
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e) {
            string logvalue = textBox1.Text;
            if (string.IsNullOrEmpty(logvalue))
                return;
#if DEBUG
            int cnt = 100000;
            Thread thread = new Thread(
                () => {
                    System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
                    sw.Start();

                    for (int i = 0; i < cnt; i++) {
                        Debug.Log(logvalue);
                        Debug.Info(logvalue);
                        Debug.Warning(logvalue);
                        Debug.ImportantLog(logvalue);
                        Debug.Error(logvalue);
                        Debug.Fatal(logvalue);
                    }
                    sw.Stop();

                    double speed = sw.ElapsedMilliseconds;

                    this.Invoke((Action)(() => { this.label2.Text = speed.ToString(); }));
                }
                );
            thread.Start();
#endif
        }


    }
}
