Bump BouncyCastle.Cryptography from 2.2.1 to 2.3.1 in /XUnitTest.Core (#142)
dependabot[bot] 编写于 2024-05-15 07:16:03 GitHub 提交于 2024-05-15 07:16:03
X
using System;
using System.Diagnostics;
using NewLife.Log;
using NewLife.Threading;
using NewLife;

namespace Test2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            XTrace.UseConsole();

            TimerScheduler.Default.Log = XTrace.Log;

            while (true)
            {
                var sw = Stopwatch.StartNew();
#if !DEBUG
                try
                {
#endif
                    Test1();
#if !DEBUG
                }
                catch (Exception ex)
                {
                    XTrace.WriteException(ex?.GetTrue());
                }
#endif

                sw.Stop();
                Console.WriteLine("OK! 耗时 {0}", sw.Elapsed);
                //Thread.Sleep(5000);
                GC.Collect();
                GC.WaitForPendingFinalizers();
                var key = Console.ReadKey(true);
                if (key.Key != ConsoleKey.C) break;
            }
        }

        static void Test1()
        {
            var str = $"{DateTime.Now:yyyy}年,学无先后达者为师!";
            str.SpeakAsync();
        }
    }
}