Exemplo n.º 1
0
 public void LogTest()
 {
     for (int i = 0; i < 10; i++)
     {
         threadPoolExecutor.AddTask(() => { Log.LogDebug("任务", "内容。。。"); });
     }
     threadPoolExecutor.Start();
     while (threadPoolExecutor.TaskList.Count > 0)
     {
         System.Threading.Thread.Sleep(500);
     }
     threadPoolExecutor.Stop();
     threadPoolExecutor.AddTask(() => { Log.LogDebug("任务", "时间:" + DateTime.Now); }, DateTime.Now.AddSeconds(5));
     threadPoolExecutor.Start();
     while (threadPoolExecutor.TaskList.Count > 0)
     {
         System.Threading.Thread.Sleep(500);
     }
 }