Beispiel #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);
        }
Beispiel #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());
        }
Beispiel #3
0
 /// <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());
 }