예제 #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 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());
        }
예제 #3
0
파일: IpMine.cs 프로젝트: Nucs/nlib
 /// <summary>
 ///     Called before mining, return true to start mining or false to abort mning and return default(OUT)
 /// </summary>
 /// <returns></returns>
 public override bool PriorToMining()
 {
     return(IpResolver.IsInternetConnectionAvailable());
 }