コード例 #1
0
        static async ValueTask BenchmarkClient(WorkUnit workUnit, int iterations = 10, int countPerIteration = 100)
        {
            for (int i = 0; i < 10; i++)
            {
                var watch = Stopwatch.StartNew();
                await workUnit.Execute(gibberish, countPerIteration);

                watch.Stop();
                Console.WriteLine($"{countPerIteration}x{gibberish.Length}: {watch.ElapsedMilliseconds}ms");
            }
        }