예제 #1
0
 public void AsyncResolvePublicIpTest() {
     var n = new FastHttpClient(); //init settings
     Thread.Sleep(3000);
     var sw = new Stopwatch();
     sw.Start();
     Assert.IsNotNull(IpResolver.GetPublic());
     Debug.WriteLine(sw.ElapsedMilliseconds);
 }
예제 #2
0
        public void AsyncResolvePublicIpTest()
        {
            var n = new FastHttpClient(); //init settings

            Thread.Sleep(3000);
            var sw = new Stopwatch();

            sw.Start();
            Assert.IsNotNull(IpResolver.GetPublic());
            Debug.WriteLine(sw.ElapsedMilliseconds);
        }
예제 #3
0
 public void MultiAsyncResolvePublicIpTest() {
     var l = new List<long>();
     var n = new FastHttpClient(); //init settings
     Thread.Sleep(3000);
     var sw = new Stopwatch();
     for (int i = 0; i < 20; i++) {
         sw.Restart();
         Assert.IsNotNull(IpResolver.GetPublic());
         Debug.WriteLine(sw.ElapsedMilliseconds);
         l.Add(sw.ElapsedMilliseconds);
     }
     Debug.WriteLine("Average: "+l.Average());
 }
예제 #4
0
        public void MultiAsyncResolvePublicIpTest()
        {
            var l = new List <long>();
            var n = new FastHttpClient(); //init settings

            Thread.Sleep(3000);
            var sw = new Stopwatch();

            for (int i = 0; i < 20; i++)
            {
                sw.Restart();
                Assert.IsNotNull(IpResolver.GetPublic());
                Debug.WriteLine(sw.ElapsedMilliseconds);
                l.Add(sw.ElapsedMilliseconds);
            }
            Debug.WriteLine("Average: " + l.Average());
        }