Esempio n. 1
0
        static void RunUdpBenchmark()
        {
            var pairs = new[]
            {
                new Tuple <int, int>(1, 1),
                new Tuple <int, int>(10, 1),
                new Tuple <int, int>(1, 100),
                new Tuple <int, int>(1, 1000),
                new Tuple <int, int>(10, 10),
                new Tuple <int, int>(10, 100),
                new Tuple <int, int>(10, 1000),
                new Tuple <int, int>(100, 100),
                new Tuple <int, int>(100, 1000),
                new Tuple <int, int>(1000, 1000),
            };

            foreach (Tuple <int, int> pair in pairs)
            {
                Console.WriteLine($"{nameof(RunUdpBenchmark)} Sender ({pair.Item1}) Receiver ({pair.Item2})");
                using (var udpPummel = new UdpPummel(pair.Item1, pair.Item2, 0))
                {
                    udpPummel.Run();
                }
            }

            foreach (Tuple <int, int> pair in pairs)
            {
                Console.WriteLine($"{nameof(RunUdpBenchmark)} Sender ({pair.Item1}) Receiver ({pair.Item2}) in 5 seconds.");
                using (var udpPummel = new UdpPummel(pair.Item1, pair.Item2, 5000)) // ms
                {
                    udpPummel.Run();
                }
            }
        }
Esempio n. 2
0
        static void RunUdpBenchmark(string name)
        {
            if (string.IsNullOrEmpty(name) ||
                string.Compare(name, "pummel", StringComparison.CurrentCultureIgnoreCase) == 0)
            {
                var pairs = new[]
                {
                    new Tuple <int, int>(1, 1),
                    new Tuple <int, int>(10, 1),
                    new Tuple <int, int>(1, 100),
                    new Tuple <int, int>(1, 1000),
                    new Tuple <int, int>(10, 10),
                    new Tuple <int, int>(10, 100),
                    new Tuple <int, int>(10, 1000),
                    new Tuple <int, int>(100, 100),
                    new Tuple <int, int>(100, 1000),
                    new Tuple <int, int>(1000, 1000),
                };

                foreach (Tuple <int, int> pair in pairs)
                {
                    Console.WriteLine($"{nameof(RunUdpBenchmark)} Sender ({pair.Item1}) Receiver ({pair.Item2})");
                    using (var udpPummel = new UdpPummel(pair.Item1, pair.Item2, 0))
                    {
                        udpPummel.Run();
                    }
                }

                foreach (Tuple <int, int> pair in pairs)
                {
                    Console.WriteLine($"{nameof(RunUdpBenchmark)} Sender ({pair.Item1}) Receiver ({pair.Item2}) in 5 seconds.");
                    using (var udpPummel = new UdpPummel(pair.Item1, pair.Item2, 5000)) // ms
                    {
                        udpPummel.Run();
                    }
                }
            }
        }