예제 #1
0
        private static async Task ListPersons(PersonServiceClient client)
        {
            var reply = await client.ListAsync(new Empty());

            Console.WriteLine("Persons: " + reply.Persons);

            var sw    = Stopwatch.StartNew();
            var loops = 1000;

            for (var i = 0; i < loops; i++)
            {
                reply = await client.ListAsync(new Empty());

                var person = reply.Persons[0];
                //Console.WriteLine(person.FirstName);
            }
            sw.Stop();
            Console.WriteLine($"Calling ListPersons {loops} times took {sw.ElapsedMilliseconds} ms.");
        }