基于StackOverflow上的问答修改而来

 /// <summary>
        /// 获取当前计算机到指定服务器列表的延迟平均值
        /// </summary>
        /// <param name="urls">要进行计算的服务器列表</param>
        /// <param name="TryTimes">进行ping的次数</param>
        /// <returns></returns>
        static Dictionary<string,Double> GetDelayFromServers(List<string> urls,int TryTimes=3)
        {
            var result = new Dictionary<string, Double>();
            foreach (string item in urls)
            {
               var delay = Enumerable.Repeat<string>(item, TryTimes).AsParallel().WithDegreeOfParallelism(64).Select(h => new Ping().Send(h).RoundtripTime).Average();
                result.Add(item, delay);
            }
            return result;
        }